I have a web service built with VRaptor that uses CDI (weld 2.1.2.Final). I need to parallelize some of the processing made by the server (statistical analysis of industrial alarms). I'm doing that using a ExecutorService and Callable instances, unfortunately I need one Request Scoped dependence inside my Threads. Because of that dependence I'm facing this error:
WELD-001303: No active contexts for scope type javax.enterprise.context.RequestScoped
Is there a way to link the Threads to the Request where they were created using CDI?
*I know that I shouldn't be opening threads in the server, but this is the currently most viable option