Configuring Enterprise JavaBeans asynchronous methods
You can configure the EJB container to use a ContextService instance to control which managed thread contexts are captured when an asynchronous EJB method is called. The captured contexts are established on the asynchronous thread before starting the EJB method.
About this task
When application security is enabled, only the security context is propagated to the threads on which asynchronous EJB methods are started. Configuring a ContextService instance to override the default behavior is useful when you need to propagate additional contexts to the asynchronous threads.
Before starting the EJB method on an asynchronous thread, the EJB container establishes the following contexts that are associated with the EJB:
- classloader context
- Java™ EE metadata context
Therefore, it is not necessary to propagate these contexts from the calling thread, as the EJB container replaces them with the contexts associated with the target EJB.