When there is a job that is executed by a Job executor, there is no CDI SessionScoped and RequestScoped context. A few of our business logic CDI beans are session or request scoped, but I also want them to work when executed by the JobExecutor.
I was thinking of programmaticaly creating and activating these scopes somewhere at the job executor, but I am not sure where to do that. I looked arount the implementation, and found two places that doesn't require reimplementing some of the JobExecutor related classes:
- DelegateInterceptor
- CommandInterceptor
In fact the DelegateInterceptor seems to be a perfect fit for this. What do you think?
THanks