public class JsrJobContextFactoryBean
extends java.lang.Object
implements org.springframework.beans.factory.FactoryBean<javax.batch.runtime.context.JobContext>
JobContext
for each thread in a running job.
Subsequent calls to FactoryBean.getObject()
on the same thread will
return the same instance. The JobContext
wraps a JobExecution
which is obtained in one of two ways:
StepExecution
JobExecution
via the setJobExecution(JobExecution)
Constructor and Description |
---|
JsrJobContextFactoryBean() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Used to remove the
JobContext for the current thread. |
javax.batch.runtime.context.JobContext |
getObject() |
java.lang.Class<?> |
getObjectType() |
boolean |
isSingleton() |
void |
setBatchPropertyContext(BatchPropertyContext propertyContext) |
void |
setJobExecution(JobExecution jobExecution)
Used to provide
JobContext instances to batch artifacts that
are not within the scope of a given step. |
public javax.batch.runtime.context.JobContext getObject() throws java.lang.Exception
getObject
in interface org.springframework.beans.factory.FactoryBean<javax.batch.runtime.context.JobContext>
java.lang.Exception
public java.lang.Class<?> getObjectType()
getObjectType
in interface org.springframework.beans.factory.FactoryBean<javax.batch.runtime.context.JobContext>
public boolean isSingleton()
isSingleton
in interface org.springframework.beans.factory.FactoryBean<javax.batch.runtime.context.JobContext>
public void setJobExecution(JobExecution jobExecution)
JobContext
instances to batch artifacts that
are not within the scope of a given step.jobExecution
- set the current JobExecution
public void setBatchPropertyContext(BatchPropertyContext propertyContext)
propertyContext
- the BatchPropertyContext
to obtain job properties frompublic void close()
JobContext
for the current thread. Not used via
normal processing but useful for testing.