I'm trying to make a batch using javax.batch 1.0 with Java SE 7 and Guice.
Reading the JavaEE 7 documentation about JSR-352 they obviously set-up the code to be executed within Glassfish and I found no mention about how to run it outside.
Now my problem is about JobContext interface which should be automatically injected through CDI: how to make it with Guice? Trying something like:
@Provides
@Inject
JobContext providesJobContext(Provider<JobContext> provider) {
return provider.get()
}
is conceptually wrong and it leads to StackOverflowError (so here I am :>). Is it really necessary? Examples inject it to reach Job properties. Could I reach them, maybe, through
jobOperator.getParameters(<executionID>)
?
Thank you.
I never used Weld (which, as I understand, would provide CDI on Java SE) so the only alternative would be Spring Batch.