Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #142 rename the package for the TCK and update the spec docs an…
…d poms Signed-off-by: Nathan Rauh <nathan.rauh@us.ibm.com>
- Loading branch information
Showing
42 changed files
with
259 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// | ||
// Copyright (c) 2018,2019 Contributors to the Eclipse Foundation | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
[[contextmanagerprovider]] | ||
== Context Manager Provider | ||
|
||
A MicroProfile Context Propagation implementation provides an implementation of the `org.eclipse.microprofile.context.spi.ContextManagerProvider` interface via either of the following mechanisms: | ||
|
||
- By manually registering the implementation via the static `register(ContextManagerProvider)` method. This register returns a `ContextManagerProviderRegistration` instance which can be used to unregister. | ||
|
||
- Alternately, via the `ServiceLoader`, by including a file of the following name and location: | ||
`META-INF/services/org.eclipse.microprofile.context.spi.ContextManagerProvider`. | ||
The content of the aforementioned file must a single line specifying the fully qualified name of the `ContextManagerProvider` implementation that is provided within the JAR file. | ||
|
||
The `ContextManagerProvider` implementation has one main purpose, which is to supply and maintain instances of `ContextManager` per class loader. This is done via the `getContextManager(ClassLoader)` method. | ||
|
||
In the case where the `ContextManagerProvider` is fully integrated with the container, all other methods of `ContextManagerProvider` are optional, with their default implementations being sufficient. | ||
|
||
In the case where the `ContextManagerProvider` implementation is distinct from the container, several other methods are made available to allow the container to build new instances of `ContextManager` (via `getContextManagerBuilder`), register these instances with the `ContextManagerProvider` per class loader (`registerContextManager`), and unregister these instances when the class loader is no longer valid (`releaseContextManager`). | ||
|
||
=== Context Manager | ||
|
||
`ContextManager`'s purpose is to provide builders for `ManagedExecutor` and `ThreadContext`. The builders create instances of `ManagedExecutor` and `ThreadContext` where thread context management is based on the `ThreadContextProvider`'s that are accessible to the `ServiceLoader` from the class loader that is associated with the `ContextManager` instance. | ||
|
||
=== Context Manager Builder | ||
|
||
The builder for `ContextManager` is optional if the `ContextManagerProvider` is inseparable from the container, in which case there is no need to provide an implementation. | ||
|
||
This builder enables the container to create customized instances of `ContextManager` for a particular class loader. The container can choose to have thread context providers loaded from the class loader (`addDiscoveredThreadContextProviders`) or manually supply its own (`withThreadContextProviders`). Similarly, the container can choose to have extensions loaded from the class loader (`addDiscoveredContextManagerExtensions`) or provide its own (`withContextManagerExtensions`). The container is responsible for managing registration and unregistration of all `ContextManager` instances that it builds. | ||
|
||
=== Context Manager Extension | ||
|
||
`ContextManagerExtension` is an optional plugin point that allows you to receive notification upon creation of each `ContextManager`. This serves as a convenient invocation point for enabling system wide context propagator hooks. After creating each `ContextManager`, the MicroProfile Context Propagation implementation queries the `ServiceLoader` for implementations of `org.eclipse.microprofile.context.spi.ContextManagerExtension` and invokes the setup method of each. | ||
|
||
To register a `ContextManagerExtension`, a JAR file that is accessible from the class loader associated with the `ContextManager` must include a file of the following name and location, | ||
|
||
---- | ||
META-INF/services/org.eclipse.microprofile.context.spi.ContextManagerExtension | ||
---- | ||
|
||
The content of the aforementioned file must be one or more lines, each specifying the fully qualified name of a `ContextManagerExtension` implementation that is provided within the JAR file. |
Oops, something went wrong.