Class Scripts
java.lang.Object
org.springframework.integration.scripting.dsl.Scripts
public final class Scripts
extends java.lang.Object
The factory for Dynamic Language Scripts (Groovy, Ruby, Python, JavaScript etc.).
- Since:
- 5.0
-
Method Summary
Modifier and Type Method Description static ScriptMessageSourceSpecmessageSource(java.lang.String scriptLocation)Factory for theScriptMessageSourceSpecbased on the script location.static ScriptMessageSourceSpecmessageSource(org.springframework.core.io.Resource scriptResource)Factory for theScriptMessageSourceSpecbased on theResource.static ScriptSpecprocessor(java.lang.String scriptLocation)The factory method to produceScriptSpecbased on the script file location.static ScriptSpecprocessor(org.springframework.core.io.Resource scriptResource)The factory method to produceScriptSpecbased on theResource.
-
Method Details
-
processor
The factory method to produceScriptSpecbased on theResource. TheResourcemust represent the real file and can be injected like:@Value("com/my/project/scripts/FilterScript.groovy") private Resource filterScript;- Parameters:
scriptResource- the script fileResource- Returns:
- the ScriptSpec instance
-
processor
The factory method to produceScriptSpecbased on the script file location.- Parameters:
scriptLocation- the path to the script file.file:,ftp:,s3:etc. Theclasspath:can be omitted.- Returns:
- the ScriptSpec instance
-
messageSource
public static ScriptMessageSourceSpec messageSource(org.springframework.core.io.Resource scriptResource)Factory for theScriptMessageSourceSpecbased on theResource. TheResourcemust represent the real file and can be injected like:@Value("com/my/project/scripts/FilterScript.groovy") private Resource filterScript;- Parameters:
scriptResource- the scriptResource- Returns:
- the
ScriptMessageSourceSpec
-
messageSource
Factory for theScriptMessageSourceSpecbased on the script location.- Parameters:
scriptLocation- the path to the script file.file:,ftp:,s3:etc. Theclasspath:can be omitted.- Returns:
- the
ScriptMessageSourceSpec
-