Package org.glassfish.jersey.jdkhttp
Class JdkHttpServerFactory
java.lang.Object
org.glassfish.jersey.jdkhttp.JdkHttpServerFactory
Factory for creating
JDK HttpServer
instances to run Jersey applications.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.sun.net.httpserver.HttpServer
createHttpServer
(URI uri, JdkHttpHandlerContainer handler, boolean start) private static com.sun.net.httpserver.HttpServer
createHttpServer
(URI uri, JdkHttpHandlerContainer handler, SSLContext sslContext, boolean start) static com.sun.net.httpserver.HttpServer
createHttpServer
(URI uri, ResourceConfig configuration) Create and start theJDK HttpServer
with the Jersey application deployed at the givenURI
.static com.sun.net.httpserver.HttpServer
createHttpServer
(URI uri, ResourceConfig configuration, boolean start) Create (and possibly start) theJDK HttpServer
with the JAX-RS / Jersey application deployed on the givenURI
.static com.sun.net.httpserver.HttpServer
createHttpServer
(URI uri, ResourceConfig configuration, Object parentContext) Create (and possibly start) theJDK HttpServer
with the JAX-RS / Jersey application deployed on the givenURI
.static com.sun.net.httpserver.HttpServer
createHttpServer
(URI uri, ResourceConfig configuration, Object parentContext, SSLContext sslContext, boolean start) Create (and possibly start) theJDK HttpServer
, eventuallyHttpServer
's subclassHttpsServer
with the JAX-RS / Jersey application deployed on the givenURI
.static com.sun.net.httpserver.HttpServer
createHttpServer
(URI uri, ResourceConfig configuration, SSLContext sslContext) Create and start theJDK HttpServer
, eventuallyHttpServer
's subclassJDK HttpsServer
with the JAX-RS / Jersey application deployed on the givenURI
.static com.sun.net.httpserver.HttpServer
createHttpServer
(URI uri, ResourceConfig configuration, SSLContext sslContext, boolean start) Create (and possibly start) theJDK HttpServer
, eventuallyHttpServer
's subclassJDK HttpsServer
with the JAX-RS / Jersey application deployed on the givenURI
.private static com.sun.net.httpserver.HttpServer
createHttpServerWrapper
(com.sun.net.httpserver.HttpServer delegate, JdkHttpHandlerContainer handler) private static com.sun.net.httpserver.HttpServer
createHttpsServerWrapper
(com.sun.net.httpserver.HttpsServer delegate, JdkHttpHandlerContainer handler)
-
Field Details
-
LOG
-
-
Constructor Details
-
JdkHttpServerFactory
private JdkHttpServerFactory()Prevents instantiation.
-
-
Method Details
-
createHttpServer
public static com.sun.net.httpserver.HttpServer createHttpServer(URI uri, ResourceConfig configuration) Create and start theJDK HttpServer
with the Jersey application deployed at the givenURI
.The returned
JDK HttpServer
is started.- Parameters:
uri
- theuri
on which the Jersey application will be deployed.configuration
- the Jersey server-side application configuration.- Returns:
- Newly created
HttpServer
. - Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation occurs.
-
createHttpServer
public static com.sun.net.httpserver.HttpServer createHttpServer(URI uri, ResourceConfig configuration, boolean start) Create (and possibly start) theJDK HttpServer
with the JAX-RS / Jersey application deployed on the givenURI
.The
start
flag controls whether or not the returnedJDK HttpServer
is started.- Parameters:
uri
- theuri
on which the Jersey application will be deployed.configuration
- the Jersey server-side application configuration.start
- if set tofalse
, the created server will not be automatically started.- Returns:
- Newly created
HttpServer
. - Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation occurs.- Since:
- 2.8
-
createHttpServer
public static com.sun.net.httpserver.HttpServer createHttpServer(URI uri, ResourceConfig configuration, Object parentContext) Create (and possibly start) theJDK HttpServer
with the JAX-RS / Jersey application deployed on the givenURI
.- Parameters:
uri
- theuri
on which the Jersey application will be deployed.configuration
- the Jersey server-side application configuration.parentContext
- DI provider specific context with application's registered bindings.- Returns:
- Newly created
HttpServer
. - Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation occurs.- Since:
- 2.12
- See Also:
-
createHttpServer
public static com.sun.net.httpserver.HttpServer createHttpServer(URI uri, ResourceConfig configuration, SSLContext sslContext) Create and start theJDK HttpServer
, eventuallyHttpServer
's subclassJDK HttpsServer
with the JAX-RS / Jersey application deployed on the givenURI
.The returned
JDK HttpServer
is started.- Parameters:
uri
- theuri
on which the Jersey application will be deployed.configuration
- the Jersey server-side application configuration.sslContext
- customSSLContext
to be passed to the server- Returns:
- Newly created
HttpServer
. - Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation occurs.- Since:
- 2.18
-
createHttpServer
public static com.sun.net.httpserver.HttpServer createHttpServer(URI uri, ResourceConfig configuration, SSLContext sslContext, boolean start) Create (and possibly start) theJDK HttpServer
, eventuallyHttpServer
's subclassJDK HttpsServer
with the JAX-RS / Jersey application deployed on the givenURI
.The
start
flag controls whether or not the returnedJDK HttpServer
is started.- Parameters:
uri
- theuri
on which the Jersey application will be deployed.configuration
- the Jersey server-side application configuration.sslContext
- customSSLContext
to be passed to the serverstart
- if set tofalse
, the created server will not be automatically started.- Returns:
- Newly created
HttpServer
. - Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation occurs.- Since:
- 2.17
-
createHttpServer
public static com.sun.net.httpserver.HttpServer createHttpServer(URI uri, ResourceConfig configuration, Object parentContext, SSLContext sslContext, boolean start) Create (and possibly start) theJDK HttpServer
, eventuallyHttpServer
's subclassHttpsServer
with the JAX-RS / Jersey application deployed on the givenURI
.The
start
flag controls whether or not the returnedJDK HttpServer
is started.- Parameters:
uri
- theuri
on which the Jersey application will be deployed.configuration
- the Jersey server-side application configuration.parentContext
- DI provider specific context with application's registered bindings.sslContext
- customSSLContext
to be passed to the serverstart
- if set tofalse
, the created server will not be automatically started.- Returns:
- Newly created
HttpServer
. - Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation occurs.- Since:
- 2.18
-
createHttpServer
private static com.sun.net.httpserver.HttpServer createHttpServer(URI uri, JdkHttpHandlerContainer handler, boolean start) -
createHttpServer
private static com.sun.net.httpserver.HttpServer createHttpServer(URI uri, JdkHttpHandlerContainer handler, SSLContext sslContext, boolean start) -
createHttpsServerWrapper
private static com.sun.net.httpserver.HttpServer createHttpsServerWrapper(com.sun.net.httpserver.HttpsServer delegate, JdkHttpHandlerContainer handler) -
createHttpServerWrapper
private static com.sun.net.httpserver.HttpServer createHttpServerWrapper(com.sun.net.httpserver.HttpServer delegate, JdkHttpHandlerContainer handler)
-