Interface ThreadContextProvider


public interface ThreadContextProvider
Third party providers of thread context implement this interface to participate in thread context capture and propagation.

Application code must never access the classes within this spi package. Instead, application code uses the various interfaces that are defined by the Jakarta Concurrency specification, such as ManagedExecutorService and ContextService.

The ThreadContextProvider implementation and related classes are packaged within the third party provider's JAR file. The implementation is made discoverable via the ServiceLoader mechanism. The JAR file that packages it must include a file with the following name and location,

META-INF/services/jakarta.enterprise.concurrent.spi.ThreadContextProvider

The content of the aforementioned file must be one or more lines, each specifying the fully qualified name of a ThreadContextProvider implementation that is provided within the JAR file.

The Jakarta EE Product Provider must use the ServiceLoader to identify all available implementations of ThreadContextProvider that can participate in thread context capture and propagation and must invoke them either to capture current thread context or establish default thread context per the configuration of the ContextServiceDefinition, or vendor-specific configuration, and execution properties such as ManagedTask.TRANSACTION that override context propagation configuration.

Since:
3.0