Case2 is a nicer way to start things but you'd need to evolve it further by adding an option to accept additional "free" parameters?
Let's not forget we will have to retrieve the JobOperator ourselves. Which will prove... difficult at best:
- `BatchRuntime.getJobOperator()`, which we are supposed to use with JavaSE, doesn't have a specified behavior (the spec only mentions it is "a factory method"). Looking at the javax.batch code, it currently returns a new operator with each call, so it creates a new thread pool and so on unless the implementation has some safeguards like JBeret does (it throws an exception if you try to instantiate two JobOperators in the same classloader).
- `@Inject JobOperator jobOperator`, which we are supposed to use with JavaEE, is not an option here for obvious reasons.
So... API issues aside, there are feasibility issues. Let's not do this? |