[cdi-dev] InvocationScoped | RequestScoped thread context

Sebastian Daschner java at sebastian-daschner.de
Sat Jan 7 07:42:43 EST 2017


Hi experts,

Regarding scopes, specificly @RequestScoped: We found in enterprise
projects that there is a need for a request / invocation scope that is
active during an invocation of a business method (HTTP, JMS, EJB, timer,
whatever), regardless how many threads are involved. Naively, one could
presume that @RequestScoped would deal that, but since it's strictly
single threaded and not accessible from asyncronously started threads
(ManagedExecuterService and so forth) that doesn't help much.

This scope would e.g. enable correlation IDs that are needed in all
threads started from one original invocation. Name is up to better
suggestions :-)

I guess it's not possible to change the behavior of @RequestScoped and
to make it available in asyncronously started threads? Have there been
considerations for adding such a scope or similar in the past?

Cheers,
Sebastian



More information about the cdi-dev mailing list