Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jakarta EE namespace transition #4474

Merged
merged 1 commit into from
May 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions bundles/jaxrs-ri/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet4.version}</version>
<version>${servlet5.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -278,12 +278,12 @@
jersey.repackaged.org.objectweb.asm.*;version=${project.version}
</Export-Package>
<Import-Package><![CDATA[
javax.servlet.annotation.*;resolution:=optional;version="[2.4,5.0)",
javax.servlet.descriptor.*;resolution:=optional;version="[2.4,5.0)",
javax.servlet.*;version="[2.4,5.0)",
jakarta.servlet.annotation.*;resolution:=optional;version="[5.0,6.0)",
jakarta.servlet.descriptor.*;resolution:=optional;version="[5.0,6.0)",
jakarta.servlet.*;version="[5.0,6.0)",
${jakarta.annotation.osgi.version},
javax.persistence.*;resolution:=optional,
jakarta.validation.*;resolution:=optional;version="[2,4)",
jakarta.persistence.*;resolution:=optional,
jakarta.validation.*;resolution:=optional;version="[3,4)",
sun.misc.*;resolution:=optional,
${hk2.osgi.version},
*
Expand Down
3 changes: 1 addition & 2 deletions containers/glassfish/jersey-gf-ejb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,12 @@
<dependency>
<groupId>jakarta.ejb</groupId>
<artifactId>jakarta.ejb-api</artifactId>
<version>${ejb.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>jakarta.interceptor</groupId>
<artifactId>jakarta.interceptor-api</artifactId>
<version>${javax.interceptor.version}</version>
<version>${jakarta.interceptor.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.glassfish.jersey.gf.ejb.internal;

import jakarta.annotation.PostConstruct;
import javax.interceptor.InvocationContext;
import jakarta.interceptor.InvocationContext;

import org.glassfish.jersey.ext.cdi1x.internal.CdiComponentProvider;
import org.glassfish.jersey.internal.inject.InjectionManager;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
import jakarta.ws.rs.ext.ExceptionMapper;

import jakarta.annotation.Priority;
import javax.ejb.Local;
import javax.ejb.Remote;
import javax.ejb.Stateless;
import jakarta.ejb.Local;
import jakarta.ejb.Remote;
import jakarta.ejb.Stateless;
import jakarta.inject.Singleton;
import javax.naming.InitialContext;
import javax.naming.NamingException;
Expand Down Expand Up @@ -117,7 +117,7 @@ private static <T> String getBeanName(final Class<T> clazz) {
}
return stateless.name();
}
final javax.ejb.Singleton singleton = clazz.getAnnotation(javax.ejb.Singleton.class);
final jakarta.ejb.Singleton singleton = clazz.getAnnotation(jakarta.ejb.Singleton.class);
if (singleton != null) {
if (singleton.name().isEmpty()) {
return clazz.getSimpleName();
Expand All @@ -139,9 +139,9 @@ public EjbFactory(Class<T> rawType, InitialContext ctx, EjbComponentProvider ejb
* Annotations to determine EJB components.
*/
private static final Set<String> EjbComponentAnnotations = Collections.unmodifiableSet(new HashSet<String>() {{
add("javax.ejb.Stateful");
add("javax.ejb.Stateless");
add("javax.ejb.Singleton");
add("jakarta.ejb.Stateful");
add("jakarta.ejb.Stateless");
add("jakarta.ejb.Singleton");
}});

private InjectionManager injectionManager = null;
Expand Down Expand Up @@ -380,7 +380,7 @@ private static List<Class> remoteAndLocalIfaces(final Class<?> resourceClass) {
}

private static boolean isAcceptableLocalInterface(final Class<?> iface) {
if ("javax.ejb".equals(iface.getPackage().getName())) {
if ("jakarta.ejb".equals(iface.getPackage().getName())) {
return false;
}
return !Serializable.class.equals(iface) && !Externalizable.class.equals(iface);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.ext.ExceptionMapper;

import javax.ejb.EJBException;
import jakarta.ejb.EJBException;
import jakarta.inject.Inject;
import jakarta.inject.Provider;

Expand Down
4 changes: 2 additions & 2 deletions containers/grizzly2-servlet/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet4.version}</version>
<version>5.0.0-M1</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -81,7 +81,7 @@
<configuration>
<instructions>
<Import-Package>
javax.servlet.*;version="[2.4,5.0)",
jakarta.servlet.*;version="[5.0,6.0)",
*
</Import-Package>
</instructions>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.net.URI;
import java.util.Map;

import javax.servlet.Servlet;
import jakarta.servlet.Servlet;

import org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory;
import org.glassfish.jersey.servlet.ServletContainer;
Expand Down
2 changes: 1 addition & 1 deletion containers/jersey-servlet-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${servlet4.version}</version>
<version>${servlet5.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@
import jakarta.ws.rs.core.UriBuilder;
import jakarta.ws.rs.core.UriBuilderException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.glassfish.jersey.internal.inject.Providers;
import org.glassfish.jersey.internal.util.ExtendedLogger;
Expand All @@ -58,7 +58,7 @@
import org.glassfish.jersey.uri.UriComponent;

/**
* A {@link javax.servlet.Servlet} or {@link Filter} for deploying root resource classes.
* A {@link jakarta.servlet.Servlet} or {@link Filter} for deploying root resource classes.
* <p />
* The following sections make reference to initialization parameters. Unless
* otherwise specified the initialization parameters apply to both server
Expand Down Expand Up @@ -96,8 +96,8 @@
* and {@link jakarta.ws.rs.core.Application} classes using {@link jakarta.ws.rs.core.Context
* &#64;Context} annotation:
* {@link HttpServletRequest}, {@link HttpServletResponse},
* {@link ServletContext}, {@link javax.servlet.ServletConfig} and {@link WebConfig}.
* If this class is used as a Servlet then the {@link javax.servlet.ServletConfig} class may
* {@link ServletContext}, {@link jakarta.servlet.ServletConfig} and {@link WebConfig}.
* If this class is used as a Servlet then the {@link jakarta.servlet.ServletConfig} class may
* be injected. If this class is used as a servlet filter then the {@link FilterConfig}
* class may be injected. {@link WebConfig} may be injected to abstract
* servlet or filter deployment.
Expand All @@ -120,7 +120,7 @@
* <param-value>persistence/widget</param-value>
* </init-param>
* }</pre>
* Given the above, Jersey will inject the {@link javax.persistence.EntityManagerFactory EntityManagerFactory} found
* Given the above, Jersey will inject the {@link jakarta.persistence.EntityManagerFactory EntityManagerFactory} found
* at {@code java:comp/env/persistence/widget} in JNDI when encountering a
* field or parameter annotated with {@code @PersistenceUnit(unitName="WidgetPU")}.
*
Expand Down Expand Up @@ -148,7 +148,7 @@ public class ServletContainer extends HttpServlet implements Filter, Container {
* Initiate the Web component.
*
* @param webConfig the Web configuration.
* @throws javax.servlet.ServletException in case of an initialization failure
* @throws jakarta.servlet.ServletException in case of an initialization failure
*/
protected void init(final WebConfig webConfig) throws ServletException {
webComponent = new WebComponent(webConfig, resourceConfig);
Expand Down Expand Up @@ -187,7 +187,7 @@ public ServletContainer(final ResourceConfig resourceConfig) {
* HTTP request
* @throws ServletException if the HTTP request cannot
* be handled
* @see javax.servlet.Servlet#service
* @see jakarta.servlet.Servlet#service
*/
@Override
public void service(final ServletRequest req, final ServletResponse res)
Expand All @@ -209,7 +209,7 @@ public void service(final ServletRequest req, final ServletResponse res)
* Receives standard HTTP requests from the public {@code service} method and dispatches
* them to the {@code do}<i>XXX</i> methods defined in
* this class. This method is an HTTP-specific version of the
* {@link javax.servlet.Servlet#service} method. There's no
* {@link jakarta.servlet.Servlet#service} method. There's no
* need to override this method.
*
* @param request the {@link HttpServletRequest} object that
Expand All @@ -223,7 +223,7 @@ public void service(final ServletRequest req, final ServletResponse res)
* HTTP request
* @throws ServletException if the HTTP request
* cannot be handled
* @see javax.servlet.Servlet#service
* @see jakarta.servlet.Servlet#service
*/
@Override
protected void service(final HttpServletRequest request, final HttpServletResponse response)
Expand Down Expand Up @@ -352,9 +352,9 @@ public void init() throws ServletException {
*
* @param baseUri the base URI of the request.
* @param requestUri the URI of the request.
* @param request the {@link javax.servlet.http.HttpServletRequest} object that contains the request the client made to
* @param request the {@link jakarta.servlet.http.HttpServletRequest} object that contains the request the client made to
* the Web component.
* @param response the {@link javax.servlet.http.HttpServletResponse} object that contains the response the Web component
* @param response the {@link jakarta.servlet.http.HttpServletResponse} object that contains the response the Web component
* returns to the client.
* @return lazily initialized response status code {@link Value value provider}. If not resolved in the moment of call to
* {@link Value#get()}, {@code -1} is returned.
Expand All @@ -372,9 +372,9 @@ public Value<Integer> service(final URI baseUri, final URI requestUri, final Htt
*
* @param baseUri the base URI of the request.
* @param requestUri the URI of the request.
* @param request the {@link javax.servlet.http.HttpServletRequest} object that contains the request the client made to
* @param request the {@link jakarta.servlet.http.HttpServletRequest} object that contains the request the client made to
* the Web component.
* @param response the {@link javax.servlet.http.HttpServletResponse} object that contains the response the Web component
* @param response the {@link jakarta.servlet.http.HttpServletResponse} object that contains the response the Web component
* returns to the client.
* @return returns {@link ResponseWriter}, Servlet's {@link org.glassfish.jersey.server.spi.ContainerResponseWriter}
* implementation, into which processed request response was written to.
Expand Down Expand Up @@ -475,19 +475,19 @@ public ServletContext getServletContext() {
* to the client.
* @param chain the chain of filters from which the next filter can be invoked.
* @throws java.io.IOException in case of an I/O error.
* @throws javax.servlet.ServletException in case of an error while executing the
* @throws jakarta.servlet.ServletException in case of an error while executing the
* filter chain.
*/
public void doFilter(final HttpServletRequest request, final HttpServletResponse response, final FilterChain chain)
throws IOException, ServletException {
if (request.getAttribute("javax.servlet.include.request_uri") != null) {
final String includeRequestURI = (String) request.getAttribute("javax.servlet.include.request_uri");
if (request.getAttribute("jakarta.servlet.include.request_uri") != null) {
final String includeRequestURI = (String) request.getAttribute("jakarta.servlet.include.request_uri");

if (!includeRequestURI.equals(request.getRequestURI())) {
doFilter(request, response, chain,
includeRequestURI,
(String) request.getAttribute("javax.servlet.include.servlet_path"),
(String) request.getAttribute("javax.servlet.include.query_string"));
(String) request.getAttribute("jakarta.servlet.include.servlet_path"),
(String) request.getAttribute("jakarta.servlet.include.query_string"));
return;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public final class ServletProperties {
* without parsing the {@code web.xml}, hence why this property is necessary.)
* <p>
* The property is only applicable when {@link ServletContainer Jersey servlet
* container} is configured to run as a {@link javax.servlet.Filter}, otherwise this property
* container} is configured to run as a {@link jakarta.servlet.Filter}, otherwise this property
* will be ignored.
* <p>
* The value of the property may consist of one or more path segments separate by
Expand All @@ -62,7 +62,7 @@ public final class ServletProperties {
* may be invoked when this feature is enabled.
* <p></p>
* The property is only applicable when {@link ServletContainer Jersey servlet
* container} is configured to run as a {@link javax.servlet.Filter}, otherwise
* container} is configured to run as a {@link jakarta.servlet.Filter}, otherwise
* this property will be ignored.
* <p></p>
* Application code, such as methods corresponding to sub-resource locators
Expand All @@ -80,7 +80,7 @@ public final class ServletProperties {
* by the underlying servlet engine.
* <p></p>
* The property is only applicable when {@link ServletContainer Jersey servlet
* container} is configured to run as a {@link javax.servlet.Filter}, otherwise
* container} is configured to run as a {@link jakarta.servlet.Filter}, otherwise
* this property will be ignored. If a servlet path matches this regular
* expression then the filter forwards the request to the next filter in the
* filter chain so that the underlying servlet engine can process the request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import java.util.Collection;
import java.util.Collections;

import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.glassfish.jersey.internal.PropertiesDelegate;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import java.util.NoSuchElementException;
import java.util.Set;

import javax.servlet.ServletContext;
import jakarta.servlet.ServletContext;

import org.glassfish.jersey.server.internal.AbstractResourceFinderAdapter;
import org.glassfish.jersey.server.internal.scanning.JarFileScanner;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
import jakarta.inject.Inject;
import jakarta.inject.Provider;
import jakarta.inject.Singleton;
import javax.servlet.FilterConfig;
import javax.servlet.ServletConfig;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.ServletConfig;
import jakarta.servlet.ServletContext;
import jakarta.servlet.ServletException;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.glassfish.jersey.internal.ServiceFinderBinder;
import org.glassfish.jersey.internal.inject.AbstractBinder;
Expand Down Expand Up @@ -325,18 +325,18 @@ public WebComponent(final WebConfig webConfig, ResourceConfig resourceConfig) th
*
* @param baseUri the base URI of the request.
* @param requestUri the URI of the request.
* @param servletRequest the {@link javax.servlet.http.HttpServletRequest} object that
* @param servletRequest the {@link jakarta.servlet.http.HttpServletRequest} object that
* contains the request the client made to
* the Web component.
* @param servletResponse the {@link javax.servlet.http.HttpServletResponse} object that
* @param servletResponse the {@link jakarta.servlet.http.HttpServletResponse} object that
* contains the response the Web component returns
* to the client.
* @return lazily initialized response status code {@link Value value provider}. If not resolved in the moment of call to
* {@link Value#get()}, {@code -1} is returned.
* @throws java.io.IOException if an input or output error occurs
* while the Web component is handling the
* HTTP request.
* @throws javax.servlet.ServletException if the HTTP request cannot be handled.
* @throws jakarta.servlet.ServletException if the HTTP request cannot be handled.
*/
public Value<Integer> service(
final URI baseUri,
Expand All @@ -357,18 +357,18 @@ public Integer get() {
*
* @param baseUri the base URI of the request.
* @param requestUri the URI of the request.
* @param servletRequest the {@link javax.servlet.http.HttpServletRequest} object that
* @param servletRequest the {@link jakarta.servlet.http.HttpServletRequest} object that
* contains the request the client made to
* the Web component.
* @param servletResponse the {@link javax.servlet.http.HttpServletResponse} object that
* @param servletResponse the {@link jakarta.servlet.http.HttpServletResponse} object that
* contains the response the Web component returns
* to the client.
* @return returns {@link ResponseWriter}, Servlet's {@link org.glassfish.jersey.server.spi.ContainerResponseWriter}
* implementation, into which processed request response was written to.
* @throws java.io.IOException if an input or output error occurs
* while the Web component is handling the
* HTTP request.
* @throws javax.servlet.ServletException if the HTTP request cannot be handled.
* @throws jakarta.servlet.ServletException if the HTTP request cannot be handled.
*/
/* package */ ResponseWriter serviceImpl(
final URI baseUri,
Expand Down
Loading