Package org.glassfish.jersey.jdkhttp
Class JdkHttpServerFactory
- java.lang.Object
-
- org.glassfish.jersey.jdkhttp.JdkHttpServerFactory
-
public final class JdkHttpServerFactory extends java.lang.ObjectFactory for creatingJDK HttpServerinstances to run Jersey applications.
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.logging.LoggerLOG
-
Constructor Summary
Constructors Modifier Constructor Description privateJdkHttpServerFactory()Prevents instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static com.sun.net.httpserver.HttpServercreateHttpServer(java.net.URI uri, JdkHttpHandlerContainer handler, boolean start)private static com.sun.net.httpserver.HttpServercreateHttpServer(java.net.URI uri, JdkHttpHandlerContainer handler, javax.net.ssl.SSLContext sslContext, boolean start)static com.sun.net.httpserver.HttpServercreateHttpServer(java.net.URI uri, ResourceConfig configuration)Create and start theJDK HttpServerwith the Jersey application deployed at the givenURI.static com.sun.net.httpserver.HttpServercreateHttpServer(java.net.URI uri, ResourceConfig configuration, boolean start)Create (and possibly start) theJDK HttpServerwith the JAX-RS / Jersey application deployed on the givenURI.static com.sun.net.httpserver.HttpServercreateHttpServer(java.net.URI uri, ResourceConfig configuration, java.lang.Object parentContext)Create (and possibly start) theJDK HttpServerwith the JAX-RS / Jersey application deployed on the givenURI.static com.sun.net.httpserver.HttpServercreateHttpServer(java.net.URI uri, ResourceConfig configuration, java.lang.Object parentContext, javax.net.ssl.SSLContext sslContext, boolean start)Create (and possibly start) theJDK HttpServer, eventuallyHttpServer's subclassHttpsServerwith the JAX-RS / Jersey application deployed on the givenURI.static com.sun.net.httpserver.HttpServercreateHttpServer(java.net.URI uri, ResourceConfig configuration, javax.net.ssl.SSLContext sslContext)Create and start theJDK HttpServer, eventuallyHttpServer's subclassJDK HttpsServerwith the JAX-RS / Jersey application deployed on the givenURI.static com.sun.net.httpserver.HttpServercreateHttpServer(java.net.URI uri, ResourceConfig configuration, javax.net.ssl.SSLContext sslContext, boolean start)Create (and possibly start) theJDK HttpServer, eventuallyHttpServer's subclassJDK HttpsServerwith the JAX-RS / Jersey application deployed on the givenURI.private static com.sun.net.httpserver.HttpServercreateHttpServerWrapper(com.sun.net.httpserver.HttpServer delegate, JdkHttpHandlerContainer handler)private static com.sun.net.httpserver.HttpServercreateHttpsServerWrapper(com.sun.net.httpserver.HttpsServer delegate, JdkHttpHandlerContainer handler)
-
-
-
Method Detail
-
createHttpServer
public static com.sun.net.httpserver.HttpServer createHttpServer(java.net.URI uri, ResourceConfig configuration)Create and start theJDK HttpServerwith the Jersey application deployed at the givenURI.The returned
JDK HttpServeris started.- Parameters:
uri- theurion 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(java.net.URI uri, ResourceConfig configuration, boolean start)Create (and possibly start) theJDK HttpServerwith the JAX-RS / Jersey application deployed on the givenURI.The
startflag controls whether or not the returnedJDK HttpServeris started.- Parameters:
uri- theurion 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(java.net.URI uri, ResourceConfig configuration, java.lang.Object parentContext)Create (and possibly start) theJDK HttpServerwith the JAX-RS / Jersey application deployed on the givenURI.- Parameters:
uri- theurion 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:
JdkHttpHandlerContainer
-
createHttpServer
public static com.sun.net.httpserver.HttpServer createHttpServer(java.net.URI uri, ResourceConfig configuration, javax.net.ssl.SSLContext sslContext)Create and start theJDK HttpServer, eventuallyHttpServer's subclassJDK HttpsServerwith the JAX-RS / Jersey application deployed on the givenURI.The returned
JDK HttpServeris started.- Parameters:
uri- theurion which the Jersey application will be deployed.configuration- the Jersey server-side application configuration.sslContext- customSSLContextto 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(java.net.URI uri, ResourceConfig configuration, javax.net.ssl.SSLContext sslContext, boolean start)Create (and possibly start) theJDK HttpServer, eventuallyHttpServer's subclassJDK HttpsServerwith the JAX-RS / Jersey application deployed on the givenURI.The
startflag controls whether or not the returnedJDK HttpServeris started.- Parameters:
uri- theurion which the Jersey application will be deployed.configuration- the Jersey server-side application configuration.sslContext- customSSLContextto 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(java.net.URI uri, ResourceConfig configuration, java.lang.Object parentContext, javax.net.ssl.SSLContext sslContext, boolean start)Create (and possibly start) theJDK HttpServer, eventuallyHttpServer's subclassHttpsServerwith the JAX-RS / Jersey application deployed on the givenURI.The
startflag controls whether or not the returnedJDK HttpServeris started.- Parameters:
uri- theurion 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- customSSLContextto 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(java.net.URI uri, JdkHttpHandlerContainer handler, boolean start)
-
createHttpServer
private static com.sun.net.httpserver.HttpServer createHttpServer(java.net.URI uri, JdkHttpHandlerContainer handler, javax.net.ssl.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)
-
-