类 JsrJobContextFactoryBean
- java.lang.Object
- org.springframework.batch.core.jsr.JsrJobContextFactoryBean
- 所有已实现的接口:
org.springframework.beans.factory.FactoryBean<javax.batch.runtime.context.JobContext>
public class JsrJobContextFactoryBean extends java.lang.Object implements org.springframework.beans.factory.FactoryBean<javax.batch.runtime.context.JobContext>
Provides a singleJobContext
for each thread in a running job. Subsequent calls toFactoryBean.getObject()
on the same thread will return the same instance. TheJobContext
wraps aJobExecution
which is obtained in one of two ways:- The current step scope (getting it from the current
StepExecution
- The provided
JobExecution
via thesetJobExecution(JobExecution)
- 从以下版本开始:
- 3.0
- 作者:
- Michael Minella
构造器概要
构造器 构造器 说明 JsrJobContextFactoryBean()
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 void
close()
Used to remove theJobContext
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 provideJobContext
instances to batch artifacts that are not within the scope of a given step.
构造器详细资料
JsrJobContextFactoryBean
public JsrJobContextFactoryBean()
方法详细资料
getObject
public javax.batch.runtime.context.JobContext getObject() throws java.lang.Exception
- 指定者:
getObject
在接口中org.springframework.beans.factory.FactoryBean<javax.batch.runtime.context.JobContext>
- 抛出:
java.lang.Exception
getObjectType
public java.lang.Class<?> getObjectType()
- 指定者:
getObjectType
在接口中org.springframework.beans.factory.FactoryBean<javax.batch.runtime.context.JobContext>
isSingleton
public boolean isSingleton()
- 指定者:
isSingleton
在接口中org.springframework.beans.factory.FactoryBean<javax.batch.runtime.context.JobContext>
setJobExecution
public void setJobExecution(JobExecution jobExecution)
Used to provideJobContext
instances to batch artifacts that are not within the scope of a given step.- 参数:
jobExecution
- set the currentJobExecution
setBatchPropertyContext
public void setBatchPropertyContext(BatchPropertyContext propertyContext)
- 参数:
propertyContext
- theBatchPropertyContext
to obtain job properties from
close
public void close()
Used to remove theJobContext
for the current thread. Not used via normal processing but useful for testing.