Skip to content

Commit

Permalink
Issue #142 rename the package for the TCK and update the spec docs an…
Browse files Browse the repository at this point in the history
…d poms

Signed-off-by: Nathan Rauh <nathan.rauh@us.ibm.com>
  • Loading branch information
njr-11 committed Mar 21, 2019
1 parent 7c16560 commit a999d03
Show file tree
Hide file tree
Showing 42 changed files with 259 additions and 259 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.adoc
@@ -1,5 +1,5 @@
//
// Copyright (c) 2018 Contributors to the Eclipse Foundation
// Copyright (c) 2018,2019 Contributors to the Eclipse Foundation
//
// See the NOTICE file(s) distributed with this work for additional
// information regarding copyright ownership.
Expand All @@ -24,8 +24,8 @@ Do you want to contribute to this project? Here is what you can do:
* Fork the repository, make changes, then do a pull request.
** Remember to https://help.github.com/articles/signing-commits/[sign your commits]
** Make sure you have signed the https://www.eclipse.org/legal/ECA.php[Eclipse Contributor Agreement]
* https://github.com/eclipse/microprofile-concurrency/issues[Create or fix an issue].
* https://gitter.im/eclipse/microprofile-concurrency[Join us on Gitter to discuss this project].
* https://github.com/eclipse/microprofile-context-propagation/issues[Create or fix an issue].
* https://gitter.im/eclipse/microprofile-context-propagation[Join us on Gitter to discuss this project].
* Join our https://calendar.google.com/calendar/embed?src=gbnbc373ga40n0tvbl88nkc3r4%40group.calendar.google.com[weekly meeting] on Thursdays at https://www.timeanddate.com/time/map/[14h30 GMT].
** https://docs.google.com/document/d/1WWyBjtGxZAwIKHvM6wjjY8nQ_x9Cc7WnvMosGuwodG4/edit[Minutes and Agenda].
** https://eclipse.zoom.us/j/949859967[Meeting room].
Expand Down
6 changes: 3 additions & 3 deletions README.adoc
Expand Up @@ -18,8 +18,8 @@
//
image:https://badges.gitter.im/eclipse/microprofile-concurrency.svg[link="https://gitter.im/eclipse/microprofile-concurrency"]

[[microprofile-concurrency]]
MicroProfile Concurrency
[[microprofile-context-propagation]]
MicroProfile Context Propagation
------------------------
:toc:

Expand Down Expand Up @@ -169,7 +169,7 @@ The thread context provider SPI is defined to bridge the gap,
allowing any provider of thread context to publish and make
available the type of thread context it supports, following a
standard and predictable pattern that can be relied upon by a
MicroProfile Concurrency implementation, enabling it to
MicroProfile Context Propagation implementation, enabling it to
facilitate the inclusion of any generic thread context alongside
the spec defined thread context types that it captures and
propagates.
Expand Down
10 changes: 5 additions & 5 deletions api/pom.xml
Expand Up @@ -18,17 +18,17 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.eclipse.microprofile.concurrency</groupId>
<artifactId>microprofile-concurrency-parent</artifactId>
<groupId>org.eclipse.microprofile.context-propagation</groupId>
<artifactId>microprofile-context-propagation-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>microprofile-concurrency-api</artifactId>
<artifactId>microprofile-context-propagation-api</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>

<name>MicroProfile Concurrency</name>
<description>MicroProfile Concurrency :: API</description>
<name>MicroProfile Context Propagation</name>
<description>MicroProfile Context Propagation :: API</description>

<dependencies>
<dependency>
Expand Down
16 changes: 8 additions & 8 deletions pom.xml
Expand Up @@ -17,13 +17,13 @@

<modelVersion>4.0.0</modelVersion>

<groupId>org.eclipse.microprofile.concurrency</groupId>
<artifactId>microprofile-concurrency-parent</artifactId>
<groupId>org.eclipse.microprofile.context-propagation</groupId>
<artifactId>microprofile-context-propagation-parent</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>

<name>MicroProfile Concurrency</name>
<description>Eclipse MicroProfile Concurrency :: Parent POM</description>
<name>MicroProfile Context Propagation</name>
<description>Eclipse MicroProfile Context Propagation :: Parent POM</description>

<url>http://microprofile.io</url>

Expand Down Expand Up @@ -56,13 +56,13 @@

<issueManagement>
<system>GitHub</system>
<url>https://github.com/eclipse/microprofile-concurrency/issues</url>
<url>https://github.com/eclipse/microprofile-context-propagation/issues</url>
</issueManagement>

<scm>
<connection>scm:git:https://github.com/eclipse/microprofile-concurrency.git</connection>
<developerConnection>scm:git:git@github.com:eclipse/microprofile-concurrency.git</developerConnection>
<url>https://github.com/eclipse/microprofile-concurrency</url>
<connection>scm:git:https://github.com/eclipse/microprofile-context-propagation.git</connection>
<developerConnection>scm:git:git@github.com:eclipse/microprofile-context-propagation.git</developerConnection>
<url>https://github.com/eclipse/microprofile-context-propagation</url>
<tag>HEAD</tag>
</scm>

Expand Down
14 changes: 7 additions & 7 deletions spec/pom.xml
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright (c) 2018 Contributors to the Eclipse Foundation
~ 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.
Expand All @@ -21,16 +21,16 @@
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.eclipse.microprofile.concurrency</groupId>
<artifactId>microprofile-concurrency-parent</artifactId>
<groupId>org.eclipse.microprofile.context-propagation</groupId>
<artifactId>microprofile-context-propagation-parent</artifactId>
<version>1.0-SNAPSHOT</version>
</parent>

<artifactId>microprofile-concurrency-spec</artifactId>
<artifactId>microprofile-context-propagation-spec</artifactId>
<packaging>pom</packaging>

<name>MicroProfile Concurrency Specification</name>
<description>MicroProfile Concurrency :: Specification</description>
<name>MicroProfile Context Propagation Specification</name>
<description>MicroProfile Context Propagation :: Specification</description>

<properties>
<asciidoctor-maven.version>1.5.5</asciidoctor-maven.version>
Expand Down Expand Up @@ -88,7 +88,7 @@
</execution>
</executions>
<configuration>
<sourceDocumentName>microprofile-concurrency.asciidoc</sourceDocumentName>
<sourceDocumentName>microprofile-context-propagation.asciidoc</sourceDocumentName>
<sourceHighlighter>coderay</sourceHighlighter>
<attributes>
<license>Apache License v2.0</license>
Expand Down
10 changes: 5 additions & 5 deletions spec/src/main/asciidoc/builders.asciidoc
Expand Up @@ -17,7 +17,7 @@
[[builders]]
== Builders for ManagedExecutor and ThreadContext

MicroProfile Concurrency provides a fluent builder API to programmatically obtain instances of `ManagedExecutor` and `ThreadContext`. Builder instances are obtained via static `builder()` methods on `ManagedExecutor` and `ThreadContext`.
The MicroProfile Context Propagation spec defines a fluent builder API to programmatically obtain instances of `ManagedExecutor` and `ThreadContext`. Builder instances are obtained via static `builder()` methods on `ManagedExecutor` and `ThreadContext`.

=== Example ManagedExecutor Builder Usage

Expand All @@ -29,8 +29,8 @@ import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.microprofile.concurrent.ManagedExecutor;
import org.eclipse.microprofile.concurrent.ThreadContext;
import org.eclipse.microprofile.context.ManagedExecutor;
import org.eclipse.microprofile.context.ThreadContext;
public class ExampleServlet extends HttpServlet {
ManagedExecutor executor;
Expand Down Expand Up @@ -71,7 +71,7 @@ import javax.servlet.ServletConfig;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.microprofile.concurrent.ThreadContext;
import org.eclipse.microprofile.context.ThreadContext;
public class ExampleServlet extends HttpServlet {
ThreadContext threadContext;
Expand All @@ -93,7 +93,7 @@ public class ExampleServlet extends HttpServlet {
// By using java.util.concurrent.CompletableFuture.supplyAsync rather
// than a managed executor, context propagation is unpredictable,
// except for the contextFn action that we pre-contextualized using
// MicroProfile Concurrency's ThreadContext above.
// ThreadContext above.
stage = CompletableFuture.supplyAsync(supplier)
.thenApplyAsync(function1)
.thenApply(contextFn)
Expand Down
12 changes: 6 additions & 6 deletions spec/src/main/asciidoc/cdi.asciidoc
Expand Up @@ -14,7 +14,7 @@
// limitations under the License.
//

[[concurrencycdi]]
[[mpcontextcdi]]
== CDI Injection

In order to use `ManagedExecutor` and `ThreadContext` as CDI beans, define producer for them as `@ApplicationScoped` so that instances are shared and reused. In most cases, more granular and shorter-lived scopes are undesirable. For instance, having a new `ManagedExecutor` instance created per HTTP request typically does not make sense. In the event that a more granular scope is desired, the application must take care to supply a disposer to ensure that the executor is shut down once it is no longer needed. When using application scope, it is optional to supply a disposer because the specification requires the container to automatically shut down `ManagedExecutor` instances when the application stops.
Expand All @@ -39,8 +39,8 @@ public @interface SecurityAndCDIContext {}
Example producer and disposer,
[source, java]
----
import org.eclipse.microprofile.concurrent.ManagedExecutor;
import org.eclipse.microprofile.concurrent.ThreadContext;
import org.eclipse.microprofile.context.ManagedExecutor;
import org.eclipse.microprofile.context.ThreadContext;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
Expand All @@ -60,7 +60,7 @@ public class MyFirstBean {
Example injection point,
[source, java]
----
import org.eclipse.microprofile.concurrent.ManagedExecutor;
import org.eclipse.microprofile.context.ManagedExecutor;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
Expand Down Expand Up @@ -93,7 +93,7 @@ Example producer method,

[source, java]
----
import org.eclipse.microprofile.concurrent.ThreadContext;
import org.eclipse.microprofile.context.ThreadContext;
import javax.enterprise.context.ApplicationScoped;
import javax.enterprise.inject.Produces;
Expand All @@ -113,7 +113,7 @@ public class MyFirstBean {
Example injection point,
[source, java]
----
import org.eclipse.microprofile.concurrent.ThreadContext;
import org.eclipse.microprofile.context.ThreadContext;
import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;
...
Expand Down
54 changes: 0 additions & 54 deletions spec/src/main/asciidoc/concurrencyprovider.asciidoc

This file was deleted.

54 changes: 54 additions & 0 deletions spec/src/main/asciidoc/contextmanagerprovider.asciidoc
@@ -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.

0 comments on commit a999d03

Please sign in to comment.