Skip to content

Commit

Permalink
Merge pull request #357 from xstefank/issue-351-jakarta-rename
Browse files Browse the repository at this point in the history
Align with Jakarta EE 9.1 dependencies
  • Loading branch information
xstefank authored Dec 21, 2021
2 parents 5775670 + 2533c8a commit 6798de2
Show file tree
Hide file tree
Showing 59 changed files with 343 additions and 342 deletions.
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<!-- This is just for now and will not work if the API has a separate release cycle than the rest. -->
<groupId>org.eclipse.microprofile.lra</groupId>
<artifactId>microprofile-lra-parent</artifactId>
<version>1.1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>microprofile-lra-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,12 @@

package org.eclipse.microprofile.lra;

import javax.ws.rs.core.Response;
import jakarta.ws.rs.core.Response;

/**
* The utility class that will create the correct {@link Response} or {@link javax.ws.rs.core.Response.ResponseBuilder}
* for the response that should be returned from the LRA JAX-RS methods.
* The utility class that will create the correct {@link Response} or
* {@link jakarta.ws.rs.core.Response.ResponseBuilder} for the response that should be returned from the LRA JAX-RS
* methods.
*/
public final class LRAResponse {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
* </p>
*
* <p>
* If the <code>AfterLRA</code> method is also a JAX-RS resource method then it MUST use the {@link javax.ws.rs.PUT}
* If the <code>AfterLRA</code> method is also a JAX-RS resource method then it MUST use the {@link jakarta.ws.rs.PUT}
* request method. In this case, the LRA context is made available to the annotated method via an HTTP header with the
* name {@link LRA#LRA_HTTP_ENDED_CONTEXT_HEADER} and the final status is passed to the method as plain text
* corresponding to one of the {@link LRAStatus} enum values. If this LRA was nested then the parent LRA MUST be present
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
* </p>
*
* <p>
* If the annotation is applied to a JAX-RS resource method then the request method MUST be {@link javax.ws.rs.PUT}. The
* LRA context of the currently running LRA can be obtained by inspecting the incoming JAX-RS headers. If this LRA is
* nested then the parent LRA MUST be present in the header with the name {@link LRA#LRA_HTTP_PARENT_CONTEXT_HEADER} and
* the header value will be of type {@link java.net.URI}.
* If the annotation is applied to a JAX-RS resource method then the request method MUST be {@link jakarta.ws.rs.PUT}.
* The LRA context of the currently running LRA can be obtained by inspecting the incoming JAX-RS headers. If this LRA
* is nested then the parent LRA MUST be present in the header with the name {@link LRA#LRA_HTTP_PARENT_CONTEXT_HEADER}
* and the header value will be of type {@link java.net.URI}.
* </p>
*
* <p>
Expand Down Expand Up @@ -86,7 +86,7 @@
*
* <p>
* If the method is a JAX-RS resource method (or is a non JAX-RS method annotated with <code>&#64;Compensate</code> with
* return type <code>javax.ws.rs.core.Response</code>) then the following are the only valid response codes:
* return type <code>jakarta.ws.rs.core.Response</code>) then the following are the only valid response codes:
* </p>
*
* <table border="0" cellpadding="3" cellspacing="0" summary="Valid JAX-RS compensation response codes">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@
* </p>
*
* <p>
* If the annotation is applied to a JAX-RS resource method then the request method MUST be {@link javax.ws.rs.PUT}. The
* id of the currently running LRA can be obtained by inspecting the incoming JAX-RS headers. If this LRA is nested then
* the parent LRA MUST be present in the header with the name {@link LRA#LRA_HTTP_PARENT_CONTEXT_HEADER} and the header
* value will be of type {@link java.net.URI}.
* If the annotation is applied to a JAX-RS resource method then the request method MUST be {@link jakarta.ws.rs.PUT}.
* The id of the currently running LRA can be obtained by inspecting the incoming JAX-RS headers. If this LRA is nested
* then the parent LRA MUST be present in the header with the name {@link LRA#LRA_HTTP_PARENT_CONTEXT_HEADER} and the
* header value will be of type {@link java.net.URI}.
* </p>
*
* <p>
Expand Down Expand Up @@ -85,7 +85,7 @@
*
* <p>
* If the method is a JAX-RS resource method (or is a non JAX-RS method annotated with <code>&#64;Complete</code> with
* return type <code>javax.ws.rs.core.Response</code>) then the following are the only valid response codes:
* return type <code>jakarta.ws.rs.core.Response</code>) then the following are the only valid response codes:
* </p>
*
* <table border="0" cellpadding="3" cellspacing="0" summary="Valid JAX-RS completion response codes">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
* </p>
*
* <p>
* If the annotation is applied to a JAX-RS resource method then the request method MUST be {@link javax.ws.rs.DELETE}.
* The context of the currently running LRA can be obtained by inspecting the incoming JAX-RS headers. If this LRA is
* nested then the parent LRA MUST be present in the header with the name {@link LRA#LRA_HTTP_PARENT_CONTEXT_HEADER} and
* value is of type {@link java.net.URI}.
* If the annotation is applied to a JAX-RS resource method then the request method MUST be
* {@link jakarta.ws.rs.DELETE}. The context of the currently running LRA can be obtained by inspecting the incoming
* JAX-RS headers. If this LRA is nested then the parent LRA MUST be present in the header with the name
* {@link LRA#LRA_HTTP_PARENT_CONTEXT_HEADER} and value is of type {@link java.net.URI}.
* </p>
*
* <p>
Expand Down Expand Up @@ -77,7 +77,7 @@
* </p>
* <p>
* If the method is a JAX-RS resource method (or is a non JAX-RS method annotated with <code>&#64;Forget</code> with
* return type <code>javax.ws.rs.core.Response</code>) then the following are the only valid response codes:
* return type <code>jakarta.ws.rs.core.Response</code>) then the following are the only valid response codes:
* </p>
*
* <table border="0" cellpadding="3" cellspacing="0" summary="Valid JAX-RS response codes for Forget methods">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.ws.rs.core.Response;

import org.eclipse.microprofile.lra.annotation.ws.rs.LRA;

import jakarta.ws.rs.core.Response;

/**
* <p>
* The LRA specification supports distributed communications amongst software components and due to the unreliable
Expand All @@ -41,10 +41,10 @@
* </p>
*
* <p>
* If the annotation is applied to a JAX-RS resource method then the request method MUST be {@link javax.ws.rs.GET}. The
* context of the currently running LRA can be obtained by inspecting the incoming JAX-RS headers. If this LRA is nested
* then the parent LRA MUST be present in the header with the name {@link LRA#LRA_HTTP_PARENT_CONTEXT_HEADER} and value
* is of type {@link java.net.URI}.
* If the annotation is applied to a JAX-RS resource method then the request method MUST be {@link jakarta.ws.rs.GET}.
* The context of the currently running LRA can be obtained by inspecting the incoming JAX-RS headers. If this LRA is
* nested then the parent LRA MUST be present in the header with the name {@link LRA#LRA_HTTP_PARENT_CONTEXT_HEADER} and
* value is of type {@link java.net.URI}.
* </p>
*
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@
import java.lang.annotation.Target;
import java.time.temporal.ChronoUnit;

import javax.ws.rs.HeaderParam;
import javax.ws.rs.core.Response;

import org.eclipse.microprofile.lra.annotation.AfterLRA;
import org.eclipse.microprofile.lra.annotation.Compensate;
import org.eclipse.microprofile.lra.annotation.Complete;
import org.eclipse.microprofile.lra.annotation.Forget;
import org.eclipse.microprofile.lra.annotation.LRAStatus;
import org.eclipse.microprofile.lra.annotation.Status;

import jakarta.ws.rs.HeaderParam;
import jakarta.ws.rs.core.Response;

/**
* <p>
* An annotation for controlling the lifecycle of Long Running Actions (LRAs).
Expand Down Expand Up @@ -363,7 +363,7 @@ enum Type {
* via a JAX-RS exception mappper.
* </p>
*
* @return the {@link javax.ws.rs.core.Response.Status.Family} status families that will cause cancellation of the
* @return the {@link jakarta.ws.rs.core.Response.Status.Family} status families that will cause cancellation of the
* LRA
*/
Response.Status.Family[] cancelOnFamily() default {
Expand All @@ -384,7 +384,7 @@ Response.Status.Family[] cancelOnFamily() default {
* or via a JAX-RS exception mappper.
* </p>
*
* @return the {@link javax.ws.rs.core.Response.Status} HTTP status codes that will cause cancellation of the LRA
* @return the {@link jakarta.ws.rs.core.Response.Status} HTTP status codes that will cause cancellation of the LRA
*/
Response.Status[] cancelOn() default {};
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@
* Microprofile LRA Support.
*/

@org.osgi.annotation.versioning.Version("1.0")
@org.osgi.annotation.versioning.Version("2.0")
package org.eclipse.microprofile.lra;
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<parent>
<groupId>org.eclipse.microprofile</groupId>
<artifactId>microprofile-parent</artifactId>
<version>1.3</version>
<version>2.4</version>
</parent>

<groupId>org.eclipse.microprofile.lra</groupId>
<artifactId>microprofile-lra-parent</artifactId>
<name>MicroProfile Long Running Actions</name>
<version>1.1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
<description>Eclipse MicroProfile LRA - Parent POM</description>
<packaging>pom</packaging>

Expand Down
2 changes: 1 addition & 1 deletion spec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<!-- This is just for now and will not work if the API has a separate release cycle than the rest. -->
<groupId>org.eclipse.microprofile.lra</groupId>
<artifactId>microprofile-lra-parent</artifactId>
<version>1.1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<groupId>org.eclipse.microprofile.lra</groupId>
Expand Down
4 changes: 2 additions & 2 deletions spec/src/main/asciidoc/microprofile-lra-spec.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ MUST adhere to these predefined signatures:
error execution is handled by <<non-jax-rs-exceptions, exceptions>> thrown in the participant method
*** not applicable for `@Status` participant methods
** <<source-ParticipantStatus,ParticipantStatus>>
** `javax.ws.rs.core.Response`: handled similarly as for
** `jakarta.ws.rs.core.Response`: handled similarly as for
<<jaxrs-participant-methods, JAX-RS participant methods>>
** `java.util.concurrent.CompletionStage`: with the parameter of any of the previously
defined types
Expand Down Expand Up @@ -1131,7 +1131,7 @@ immediately the `@Compensate` method MUST report that the activity
is still in progress using one of the following options:

- Return a `CompletionStage` or mark the method as asynchronous
(using the `javax.ws.rs.container.Suspended` annotation). The future must
(using the `jakarta.ws.rs.container.Suspended` annotation). The future must
report the final status when the stage completes (if it delivers an
intermediate state then the implementation MUST use the `@Status` method if
it exists, and if there is no such method it will reinvoke the `@Compensate`
Expand Down
2 changes: 1 addition & 1 deletion tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<parent>
<groupId>org.eclipse.microprofile.lra</groupId>
<artifactId>microprofile-lra-parent</artifactId>
<version>1.1-SNAPSHOT</version>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>microprofile-lra-tck</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
*******************************************************************************/
package org.eclipse.microprofile.lra.tck;

import javax.ws.rs.ApplicationPath;
import javax.ws.rs.core.Application;
import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;

@ApplicationPath("/")
public class JaxRsActivator extends Application {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;

import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;

import org.eclipse.microprofile.lra.annotation.ws.rs.LRA;
import org.eclipse.microprofile.lra.tck.participant.api.GenericLRAException;

import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Response;

public class LRAClientOps {
private static final Logger LOGGER = Logger.getLogger(TckLRATypeTests.class.getName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@

package org.eclipse.microprofile.lra.tck;

import javax.enterprise.context.ApplicationScoped;
import javax.inject.Inject;

import org.eclipse.microprofile.config.inject.ConfigProperty;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.inject.Inject;

@ApplicationScoped
public class LraTckConfigBean {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@

import java.net.URI;

import javax.inject.Inject;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;

import org.eclipse.microprofile.lra.tck.participant.api.LraCancelOnResource;
import org.eclipse.microprofile.lra.tck.service.LRAMetricAssertions;
import org.eclipse.microprofile.lra.tck.service.LRATestService;
Expand All @@ -37,6 +32,11 @@
import org.junit.Test;
import org.junit.runner.RunWith;

import jakarta.inject.Inject;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.Response.Status;

@RunWith(Arquillian.class)
public class TckCancelOnTests extends TckTestBase {

Expand Down Expand Up @@ -148,7 +148,7 @@ public void notCancelOnFamily5xx() {
}

/**
* See {@link LraCancelOnResource#cancelFromRemoteCall(java.net.URI, javax.ws.rs.core.UriInfo)}
* See {@link LraCancelOnResource#cancelFromRemoteCall(java.net.URI, jakarta.ws.rs.core.UriInfo)}
*/
@Test
public void cancelFromRemoteCall() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@

import java.net.URI;

import javax.inject.Inject;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.Invocation;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;

import org.eclipse.microprofile.lra.annotation.ParticipantStatus;
import org.eclipse.microprofile.lra.tck.participant.api.AfterLRAListener;
import org.eclipse.microprofile.lra.tck.participant.api.ContextTckResource;
Expand All @@ -65,6 +59,12 @@
import org.junit.Test;
import org.junit.runner.RunWith;

import jakarta.inject.Inject;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Response;

/**
* test that Compensate, Complete, Status, Forget and Leave annotations work without an LRA annotation test that
* resource methods that make outgoing requests do not modify the current context when they return
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@
import java.time.temporal.ChronoUnit;
import java.util.logging.Logger;

import javax.ws.rs.client.Invocation;
import javax.ws.rs.core.Response;

import org.eclipse.microprofile.lra.annotation.ws.rs.LRA;
import org.eclipse.microprofile.lra.tck.participant.api.LRATypeTckInterface;
import org.eclipse.microprofile.lra.tck.participant.api.LRATypeTckResource;
Expand All @@ -45,6 +42,9 @@
import org.junit.Test;
import org.junit.runner.RunWith;

import jakarta.ws.rs.client.Invocation;
import jakarta.ws.rs.core.Response;

/**
* <p>
* Tests that validate that the implementation of the {@link LRA.Type} attribute is correct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@
import java.util.concurrent.TimeoutException;
import java.util.logging.Logger;

import javax.inject.Inject;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.client.Entity;
import javax.ws.rs.client.WebTarget;
import javax.ws.rs.core.Response;

import org.eclipse.microprofile.lra.annotation.ws.rs.LRA;
import org.eclipse.microprofile.lra.tck.participant.nonjaxrs.valid.LongBusinessMethodParticipant;
import org.eclipse.microprofile.lra.tck.participant.nonjaxrs.valid.ValidLRACSParticipant;
Expand All @@ -46,6 +40,12 @@
import org.junit.Test;
import org.junit.runner.RunWith;

import jakarta.inject.Inject;
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.client.Entity;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.Response;

/**
* TCK to verify that valid non-JAX-RS participant method signatures are respected
*/
Expand Down
Loading

0 comments on commit 6798de2

Please sign in to comment.