Skip to content

Commit

Permalink
Add CDI annotations to the annotations that need them. Updated the si…
Browse files Browse the repository at this point in the history
…gnature test profile to use the new maven plugin for generation.

Signed-off-by: James R. Perkins <[email protected]>
  • Loading branch information
jamezp committed Feb 21, 2024
1 parent e5994e3 commit 652819b
Show file tree
Hide file tree
Showing 15 changed files with 147 additions and 15 deletions.
5 changes: 5 additions & 0 deletions jaxrs-api/src/main/java/jakarta/ws/rs/ApplicationPath.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

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

/**
* Identifies the application path that serves as the base URI for all resource URIs provided by
* {@link jakarta.ws.rs.Path}. May only be applied to a subclass of {@link jakarta.ws.rs.core.Application}.
Expand All @@ -40,6 +43,8 @@
@Documented
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Stereotype
@ApplicationScoped
public @interface ApplicationPath {

/**
Expand Down
3 changes: 3 additions & 0 deletions jaxrs-api/src/main/java/jakarta/ws/rs/BeanParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import jakarta.inject.Qualifier;

/**
* The annotation that may be used to inject custom JAX-RS "parameter aggregator" value object into a resource class
* field, property or resource method parameter.
Expand Down Expand Up @@ -68,5 +70,6 @@
@Target({ ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface BeanParam {
}
3 changes: 3 additions & 0 deletions jaxrs-api/src/main/java/jakarta/ws/rs/CookieParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import jakarta.inject.Qualifier;

/**
* Binds the value of a HTTP cookie to a resource method parameter, resource class field, or resource class bean
* property. A default value can be specified using the {@link DefaultValue} annotation.
Expand Down Expand Up @@ -55,6 +57,7 @@
@Target({ ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface CookieParam {

/**
Expand Down
3 changes: 3 additions & 0 deletions jaxrs-api/src/main/java/jakarta/ws/rs/FormParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import jakarta.inject.Qualifier;

/**
* Binds the value(s) of a form parameter contained within a request entity body to a resource method parameter. Values
* are URL decoded unless this is disabled using the {@link Encoded} annotation. A default value can be specified using
Expand Down Expand Up @@ -66,6 +68,7 @@
@Target({ ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface FormParam {

/**
Expand Down
3 changes: 3 additions & 0 deletions jaxrs-api/src/main/java/jakarta/ws/rs/HeaderParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import jakarta.inject.Qualifier;

/**
* Binds the value(s) of a HTTP header to a resource method parameter, resource class field, or resource class bean
* property. A default value can be specified using the {@link DefaultValue} annotation.
Expand Down Expand Up @@ -58,6 +60,7 @@
@Target({ ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface HeaderParam {

/**
Expand Down
3 changes: 3 additions & 0 deletions jaxrs-api/src/main/java/jakarta/ws/rs/MatrixParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import jakarta.inject.Qualifier;

/**
* Binds the value(s) of a URI matrix parameter to a resource method parameter, resource class field, or resource class
* bean property. Values are URL decoded unless this is disabled using the {@link Encoded} annotation. A default value
Expand Down Expand Up @@ -66,6 +68,7 @@
@Target({ ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface MatrixParam {

/**
Expand Down
5 changes: 5 additions & 0 deletions jaxrs-api/src/main/java/jakarta/ws/rs/Path.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import jakarta.enterprise.context.RequestScoped;
import jakarta.enterprise.inject.Stereotype;

/**
* Identifies the URI path that a resource class or class method will serve requests for.
*
Expand Down Expand Up @@ -65,6 +68,8 @@
@Target({ ElementType.TYPE, ElementType.METHOD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Stereotype
@RequestScoped
public @interface Path {

/**
Expand Down
3 changes: 3 additions & 0 deletions jaxrs-api/src/main/java/jakarta/ws/rs/PathParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import jakarta.inject.Qualifier;

/**
* Binds the value of a URI template parameter or a path segment containing the template parameter to a resource method
* parameter, resource class field, or resource class bean property. The value is URL decoded unless this is disabled
Expand Down Expand Up @@ -67,6 +69,7 @@
@Target({ ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface PathParam {

/**
Expand Down
3 changes: 3 additions & 0 deletions jaxrs-api/src/main/java/jakarta/ws/rs/QueryParam.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import jakarta.inject.Qualifier;

/**
* Binds the value(s) of a HTTP query parameter to a resource method parameter, resource class field, or resource class
* bean property. Values are URL decoded unless this is disabled using the {@link Encoded} annotation. A default value
Expand Down Expand Up @@ -60,6 +62,7 @@
@Target({ ElementType.PARAMETER, ElementType.METHOD, ElementType.FIELD })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface QueryParam {

/**
Expand Down
5 changes: 5 additions & 0 deletions jaxrs-api/src/main/java/jakarta/ws/rs/ext/Provider.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

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

/**
* Marks an implementation of an extension interface that should be discoverable by JAX-RS runtime during a provider
* scanning phase.
Expand All @@ -33,5 +36,7 @@
@Target({ ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Stereotype
@ApplicationScoped
public @interface Provider {
}
3 changes: 3 additions & 0 deletions jaxrs-api/src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
module jakarta.ws.rs {

requires static jakarta.xml.bind;
// These two modules are not required on the client side
requires static jakarta.cdi;
requires static jakarta.inject;

requires java.logging;

Expand Down
32 changes: 21 additions & 11 deletions jaxrs-tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,17 @@
<dependency>
<groupId>jakarta.ws.rs</groupId>
<artifactId>jakarta.ws.rs-api</artifactId>
<version>${project.version}</version>
<!-- Used so the TCK version can be changed without needing to change the API version -->
<version>${project.parent.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.inject</groupId>
<artifactId>jakarta.inject-api</artifactId>
</dependency>
<dependency>
<groupId>jakarta.enterprise</groupId>
<artifactId>jakarta.enterprise.cdi-api</artifactId>
</dependency>

<dependency>
Expand Down Expand Up @@ -97,12 +107,6 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.netbeans.tools</groupId>
<artifactId>sigtest-maven-plugin</artifactId>
<version>1.4</version>
</dependency>

<!-- Test Dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand Down Expand Up @@ -147,9 +151,9 @@
<build>
<plugins>
<plugin>
<groupId>org.netbeans.tools</groupId>
<groupId>jakarta.tck</groupId>
<artifactId>sigtest-maven-plugin</artifactId>
<version>1.4</version>
<version>2.1</version>
<executions>
<execution>
<goals>
Expand All @@ -158,10 +162,16 @@
</execution>
</executions>
<configuration>
<FileName>${project.build.directory}/jakarta.ws.rs.sig_${project.parent.version}</FileName>
<packages>
jakarta.ws.rs,jakarta.ws.rs.client,jakarta.ws.rs.core,jakarta.ws.rs.container,jakarta.ws.rs.ext,jakarta.ws.rs.sse
jakarta.ws.rs,
jakarta.ws.rs.client,
jakarta.ws.rs.core,
jakarta.ws.rs.container,
jakarta.ws.rs.ext,
jakarta.ws.rs.sse
</packages>
<attach>false</attach>
<sigfile>${project.build.directory}/jakarta.ws.rs.sig_${project.parent.version}</sigfile>
</configuration>
</plugin>
</plugins>
Expand Down
Loading

0 comments on commit 652819b

Please sign in to comment.