-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable jetty servlet/web container factory
Signed-off-by: Maxim Nesen <[email protected]>
- Loading branch information
Showing
5 changed files
with
297 additions
and
15 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
2 changes: 1 addition & 1 deletion
2
...tty/servlet/JettyWebContainerFactory.java → ...tty/servlet/JettyWebContainerFactory.java
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
90 changes: 90 additions & 0 deletions
90
...y-servlet/src/main/java8/org/glassfish/jersey/jetty/servlet/JettyWebContainerFactory.java
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,90 @@ | ||
/* | ||
* Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License v. 2.0, which is available at | ||
* http://www.eclipse.org/legal/epl-2.0. | ||
* | ||
* This Source Code may also be made available under the following Secondary | ||
* Licenses when the conditions for such availability set forth in the | ||
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
* version 2 with the GNU Classpath Exception, which is available at | ||
* https://www.gnu.org/software/classpath/license.html. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
*/ | ||
|
||
package org.glassfish.jersey.jetty.servlet; | ||
|
||
import java.net.URI; | ||
import java.util.Map; | ||
|
||
import jakarta.servlet.Servlet; | ||
|
||
import jakarta.ws.rs.ProcessingException; | ||
import org.eclipse.jetty.server.Server; | ||
import org.glassfish.jersey.jetty.internal.LocalizationMessages; | ||
|
||
/** | ||
* Jersey {@code Server} stub based on Jetty {@link org.eclipse.jetty.server.Server}. | ||
* <p> | ||
* For JDK 1.8 only since Jetty 11 does not support JDKs below 11 | ||
*/ | ||
public final class JettyWebContainerFactory { | ||
|
||
private JettyWebContainerFactory() { | ||
} | ||
|
||
|
||
public static Server create(String u) | ||
throws Exception { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
|
||
public static Server create(String u, Map<String, String> initParams) | ||
throws Exception { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
|
||
public static Server create(URI u) | ||
throws Exception { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
|
||
public static Server create(URI u, Map<String, String> initParams) | ||
throws Exception { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
|
||
public static Server create(String u, Class<? extends Servlet> c) | ||
throws Exception { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
|
||
public static Server create(String u, Class<? extends Servlet> c, | ||
Map<String, String> initParams) | ||
throws Exception { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
|
||
public static Server create(URI u, Class<? extends Servlet> c) | ||
throws Exception { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
|
||
public static Server create(URI u, Class<? extends Servlet> c, Map<String, String> initParams) | ||
throws Exception { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
|
||
private static Server create(URI u, Class<? extends Servlet> c, Servlet servlet, | ||
Map<String, String> initParams, Map<String, String> contextInitParams) | ||
throws Exception { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
|
||
public static Server create(URI u, Servlet servlet, Map<String, String> initParams, Map<String, String> contextInitParams) | ||
throws Exception { | ||
throw new ProcessingException(LocalizationMessages.NOT_SUPPORTED()); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
...et/src/main/resources/org/glassfish/jersey/jetty/servlet/internal/localization.properties
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,18 @@ | ||
# | ||
# Copyright (c) 2020 Oracle and/or its affiliates. All rights reserved. | ||
# | ||
# This program and the accompanying materials are made available under the | ||
# terms of the Eclipse Public License v. 2.0, which is available at | ||
# http://www.eclipse.org/legal/epl-2.0. | ||
# | ||
# This Source Code may also be made available under the following Secondary | ||
# Licenses when the conditions for such availability set forth in the | ||
# Eclipse Public License v. 2.0 are satisfied: GNU General Public License, | ||
# version 2 with the GNU Classpath Exception, which is available at | ||
# https://www.gnu.org/software/classpath/license.html. | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 | ||
# | ||
|
||
# {0} - status code; {1} - status reason message | ||
not.supported=Jetty container is not supported on JDK version less than 11. |
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