A provider implementation supplied by the
container, which creates and caches instances of
ContextManager per class loader,
which in turn create new instances of
ManagedExecutor. and
ThreadContext..
The container must register its ContextManagerProvider
implementation via the register method, or by providing
an implementation via the standard ServiceLoader mechanism.
ContextManagerProvider implementations that wish to use
the ServiceLoader registration mechanism must include a file
of the following name and location in their jar:
META-INF/services/org.eclipse.microprofile.context.spi.ContextManagerProvider
The content of the aforementioned file must be exactly one line, specifying
the fully qualified name of a ContextManagerProvider implementation
that is provided within the JAR file.
If there is no manually registered ContextManagerProvider (via
register(ContextManagerProvider)), any call to instance() will
look up any ContextManagerProvider implementation via the aforementioned
ServiceLoader mechanism. If there are more than one such implementation
registered, the instance() method will throw an exception as documented
| Modifier and Type | Field and Description |
|---|---|
| public static final AtomicReference |
| Modifier and Type | Method and Description |
|---|---|
| public default ContextManager | |
| public ContextManager | getContextManager(ClassLoader
the class loader for which to obtain the context manager. classloader)Gets a |
| public default ContextManager. | Returns: a newContextManager.Returns a new |
| public static ContextManagerProvider | Returns: the registeredContextManagerProvider instance.Obtains the |
| public static ContextManagerProviderRegistration | Returns: registration instance that gives the caller control over unregistering.the provider implementation to register. provider)Allows the container to register the |
| public default void | registerContextManager(ContextManager
The manager, ClassLoader ContextManager to registerThe classLoader)ClassLoader to register it forRegisters the given |
| public default void | releaseContextManager(ContextManager
The manager)ContextManager to releaseReleases a |
| INSTANCE | back to summary |
|---|---|
| public static final AtomicReference<ContextManagerProvider> INSTANCE | |
| getContextManager | back to summary |
|---|---|
| public default ContextManager getContextManager() Gets a
| |
| getContextManager | back to summary |
|---|---|
| public ContextManager getContextManager(ClassLoader classloader) Gets a
| |
| getContextManagerBuilder | back to summary |
|---|---|
| public default ContextManager. Returns a new
| |
| instance | back to summary |
|---|---|
| public static ContextManagerProvider instance() Obtains the
| |
| register | back to summary |
|---|---|
| public static ContextManagerProviderRegistration register(ContextManagerProvider provider) throws IllegalStateException Allows the container to register the
| |
| registerContextManager | back to summary |
|---|---|
| public default void registerContextManager(ContextManager manager, ClassLoader classLoader) Registers the given
| |
| releaseContextManager | back to summary |
|---|---|
| public default void releaseContextManager(ContextManager manager) Releases a
| |