Class JavascriptTasklet
- java.lang.Object
-
- org.springframework.batch.core.listener.StepExecutionListenerSupport
-
- se.ikama.bauta.batch.tasklet.javascript.JavascriptTasklet
-
- All Implemented Interfaces:
org.springframework.batch.core.step.tasklet.StoppableTasklet,org.springframework.batch.core.step.tasklet.Tasklet,org.springframework.batch.core.StepExecutionListener,org.springframework.batch.core.StepListener,org.springframework.beans.factory.InitializingBean
public class JavascriptTasklet extends org.springframework.batch.core.listener.StepExecutionListenerSupport implements org.springframework.batch.core.step.tasklet.StoppableTasklet, org.springframework.beans.factory.InitializingBean
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringreportDir
-
Constructor Summary
Constructors Constructor Description JavascriptTasklet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()org.springframework.batch.repeat.RepeatStatusexecute(org.springframework.batch.core.StepContribution contribution, org.springframework.batch.core.scope.context.ChunkContext chunkContext)voidsetAddProperties(boolean addProperties)Add Spring properties as environment variables when executing the script.voidsetEnvironmentParams(java.util.Map<java.lang.String,java.lang.String> envp)voidsetExecutable(java.lang.String executable)voidsetPropertyRegex(java.lang.String propertyRegex)IfaddPropertiesis set to true, only Spring properties matching the provided regexp will be added as environment variables.voidsetScriptDir(java.lang.String dir)voidsetScriptFile(java.lang.String scriptFile)voidsetScriptFiles(java.util.List<java.lang.String> scriptFiles)voidsetScriptParameters(java.util.List<java.lang.String> scriptParameters)voidsetTerminationCheckInterval(long checkInterval)voidsetTimeout(long timeout)voidstop()
-
-
-
Method Detail
-
execute
public org.springframework.batch.repeat.RepeatStatus execute(org.springframework.batch.core.StepContribution contribution, org.springframework.batch.core.scope.context.ChunkContext chunkContext) throws java.lang.Exception- Specified by:
executein interfaceorg.springframework.batch.core.step.tasklet.Tasklet- Throws:
java.lang.Exception
-
setExecutable
public void setExecutable(java.lang.String executable)
-
setEnvironmentParams
public void setEnvironmentParams(java.util.Map<java.lang.String,java.lang.String> envp)
-
setScriptDir
public void setScriptDir(java.lang.String dir)
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
setTimeout
public void setTimeout(long timeout)
-
setTerminationCheckInterval
public void setTerminationCheckInterval(long checkInterval)
-
stop
public void stop()
- Specified by:
stopin interfaceorg.springframework.batch.core.step.tasklet.StoppableTasklet
-
setScriptFile
public void setScriptFile(java.lang.String scriptFile)
-
setScriptFiles
public void setScriptFiles(java.util.List<java.lang.String> scriptFiles)
-
setScriptParameters
public void setScriptParameters(java.util.List<java.lang.String> scriptParameters)
-
setAddProperties
public void setAddProperties(boolean addProperties)
Add Spring properties as environment variables when executing the script. If you dont want to add all properties, seesetPropertyRegex(String)- Parameters:
addProperties-
-
setPropertyRegex
public void setPropertyRegex(java.lang.String propertyRegex)
IfaddPropertiesis set to true, only Spring properties matching the provided regexp will be added as environment variables.- Parameters:
propertyRegex-
-
-