|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jmonks.batch.framework.JobContext
JobContext provides the references to the framework resources. All the jobs will receives the JobContext reference either in their initialize methods or process methods based on the controllers they choose to implement the job. It exposes the resources like reference to repository (by using which you can transfer the data between the jobs, saves the management & monitoring information and job running statistics), running job configuration (by using which you can refer the properties defined in the controller/processor configuration), configuration provided to invoke the job (could be either command line configuration or configuration provided to process method) and finally framework configuration. All the configuration maps accessed through this job context are unmodifiable. Framework creates the JobContext instance and passes it to the controllers.
Field Summary | |
static java.lang.String |
CONTEXT_PARAM_JOB_CONFIG
Constant defines the parameter name to be used in the context parameters map to pass the job configuration to create the job context. |
static java.lang.String |
CONTEXT_PARAM_JOB_INVOKE_CONFIG
Constant defines the parameter name to be used in the context parameters map to pass the job invoke configuration to create the job context. |
static java.lang.String |
CONTEXT_PARAM_REPOSITORY
Constant defines the parameter name to be used in the context parameters map to pass the repository instance to create the job context. |
protected JobConfig |
jobConfig
Holds the job configuration object reference. |
protected java.util.Map |
jobInvokeConfig
Holds the job invoke configuration reference. |
protected Repository |
repository
Holds the framework repository reference. |
Constructor Summary | |
JobContext(java.util.Map contextParams,
Main contextCreator)
Creates and Initializes the JobContext object by looking up the information in the given context parameters map. |
Method Summary | |
FrameworkConfig |
getFrameworkConfig()
Gets the reference to the framework configuration. |
JobConfig |
getJobConfig()
Gets the job configuration object belongs to the running job. |
java.util.Map |
getJobInvokeConfig()
Gets the configuration passed in the invocation to the framework. |
java.lang.String |
getJobName()
Gets the name of the job this context is associated with. |
Repository |
getRepository()
Gets the repository reference configured for this framework. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String CONTEXT_PARAM_JOB_CONFIG
public static final java.lang.String CONTEXT_PARAM_JOB_INVOKE_CONFIG
public static final java.lang.String CONTEXT_PARAM_REPOSITORY
protected JobConfig jobConfig
protected Repository repository
protected java.util.Map jobInvokeConfig
Constructor Detail |
public JobContext(java.util.Map contextParams, Main contextCreator)
Creates and Initializes the JobContext object by looking up the information in the given context parameters map. It looks for all the required parameters and then initializes the complete job context. It accepts the Main class instance context creator reference to make sure this will not be created by other than Main class.
contextParams
- Map contains all the required information to initialize the job context.contextCreator
- Main class instance to make sure nobody can instantiate the job context.
java.lang.SecurityException
- If context creator is other than Main class.
java.lang.IllegalArgumentException
- If any of the required parameters are missing in the context params.Method Detail |
public java.lang.String getJobName()
public Repository getRepository()
public JobConfig getJobConfig()
public java.util.Map getJobInvokeConfig()
public FrameworkConfig getFrameworkConfig()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |