jakartaee / batch

The Jakarta Batch project produces the Batch Specification and API.
https://projects.eclipse.org/projects/ee4j.batch
Apache License 2.0
13 stars 17 forks source link

Support StepContext.getJobContext() method #53

Open follis opened 4 years ago

follis commented 4 years ago

Originally opened as bug 5776 by cf126330

--------------Original Comment History---------------------------- Comment from = cf126330 on 2014-02-10 20:37:06 +0000

JobContext may contain contextual data a step artifact needs. Currently the only way for a batch artifact to obtain StepContext or JobContext is through injection. So if both stepContext and jobContext are needed, there will be 2 field injections. It will be nice to be able to retrive JobContext from StepContext on-demand.

@Inject StepContext stepContext;

public Object readItem() { if(needToAccessJobContext) JobContext jobContext = stepContext.getJobContext(); ... }