List of usage examples for org.springframework.batch.core.scope.context JobSynchronizationManager getContext
@Nullable public static JobContext getContext()
From source file:org.springframework.batch.core.scope.JobScope.java
/** * Get an attribute accessor in the form of a {@link JobContext} that can * be used to store scoped bean instances. * * @return the current job context which we can use as a scope storage * medium//w ww . j a v a 2 s .c o m */ private JobContext getContext() { JobContext context = JobSynchronizationManager.getContext(); if (context == null) { throw new IllegalStateException("No context holder available for job scope"); } return context; }