Package org.glassfish.jersey.simple
Class SimpleContainerFactory
- java.lang.Object
-
- org.glassfish.jersey.simple.SimpleContainerFactory
-
public final class SimpleContainerFactory extends java.lang.Object
Factory for creating and starting Simple server containers. This returns a handle to the started server asCloseable
instances, which allows the server to be stopped by invoking theCloseable.close()
method. To start the server in HTTPS mode anSSLContext
can be provided. This will be used to decrypt and encrypt information sent over the connected TCP socket channel.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
SimpleContainerFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description private static SimpleServer
_create(java.net.URI address, javax.net.ssl.SSLContext context, SimpleContainer container, UnsafeValue<org.simpleframework.transport.SocketProcessor,java.io.IOException> serverProvider)
static SimpleServer
create(java.net.URI address, javax.net.ssl.SSLContext context, ResourceConfig config)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes declared by the resource configuration.static SimpleServer
create(java.net.URI address, javax.net.ssl.SSLContext context, ResourceConfig config, int count, int select)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes declared by the resource configuration.static SimpleServer
create(java.net.URI address, javax.net.ssl.SSLContext context, ResourceConfig config, java.lang.Object parentContext, int count, int select)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes declared by the resource configuration.static SimpleServer
create(java.net.URI address, javax.net.ssl.SSLContext context, SimpleContainer container)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes found by searching the classes referenced in the java classpath.static SimpleServer
create(java.net.URI address, javax.net.ssl.SSLContext context, SimpleContainer container, int count, int select)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes found by searching the classes referenced in the java classpath.static SimpleServer
create(java.net.URI address, ResourceConfig config)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes declared by the resource configuration.static SimpleServer
create(java.net.URI address, ResourceConfig config, int count, int select)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes declared by the resource configuration.
-
-
-
Method Detail
-
create
public static SimpleServer create(java.net.URI address, ResourceConfig config)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes declared by the resource configuration.- Parameters:
address
- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI path, query and fragment components are ignored.config
- the resource configuration.- Returns:
- the closeable connection, with the endpoint started.
- Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation.java.lang.IllegalArgumentException
- ifaddress
isnull
.
-
create
public static SimpleServer create(java.net.URI address, ResourceConfig config, int count, int select)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes declared by the resource configuration.- Parameters:
address
- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI path, query and fragment components are ignored.config
- the resource configuration.count
- this is the number of threads to be used.select
- this is the number of selector threads to use.- Returns:
- the closeable connection, with the endpoint started.
- Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation.java.lang.IllegalArgumentException
- ifaddress
isnull
.
-
create
public static SimpleServer create(java.net.URI address, javax.net.ssl.SSLContext context, ResourceConfig config)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes declared by the resource configuration.- Parameters:
address
- the URI to create the http server. The URI scheme must be equal tohttps
. The URI user information and host are ignored. If the URI port is not present then port 443 will be used. The URI path, query and fragment components are ignored.context
- this is the SSL context used for SSL connections.config
- the resource configuration.- Returns:
- the closeable connection, with the endpoint started.
- Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation.java.lang.IllegalArgumentException
- ifaddress
isnull
.
-
create
public static SimpleServer create(java.net.URI address, javax.net.ssl.SSLContext context, ResourceConfig config, int count, int select)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes declared by the resource configuration.- Parameters:
address
- the URI to create the http server. The URI scheme must be equal tohttps
. The URI user information and host are ignored. If the URI port is not present then port 443 will be used. The URI path, query and fragment components are ignored.context
- this is the SSL context used for SSL connections.config
- the resource configuration.count
- this is the number of threads to be used.select
- this is the number of selector threads to use.- Returns:
- the closeable connection, with the endpoint started.
- Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation.java.lang.IllegalArgumentException
- ifaddress
isnull
.
-
create
public static SimpleServer create(java.net.URI address, javax.net.ssl.SSLContext context, SimpleContainer container)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes found by searching the classes referenced in the java classpath.- Parameters:
address
- the URI to create the http server. The URI scheme must be equal tohttps
. The URI user information and host are ignored. If the URI port is not present then port 443 will be used. The URI path, query and fragment components are ignored.context
- this is the SSL context used for SSL connections.container
- the container that handles all HTTP requests.- Returns:
- the closeable connection, with the endpoint started.
- Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation.java.lang.IllegalArgumentException
- ifaddress
isnull
.
-
create
public static SimpleServer create(java.net.URI address, javax.net.ssl.SSLContext context, ResourceConfig config, java.lang.Object parentContext, int count, int select)
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes declared by the resource configuration.- Parameters:
address
- the URI to create the http server. The URI scheme must be equal tohttps
. The URI user information and host are ignored. If the URI port is not present then port 443 will be used. The URI path, query and fragment components are ignored.context
- this is the SSL context used for SSL connections.config
- the resource configuration.parentContext
- DI provider specific context with application's registered bindings.count
- this is the number of threads to be used.select
- this is the number of selector threads to use.- Returns:
- the closeable connection, with the endpoint started.
- Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation.java.lang.IllegalArgumentException
- ifaddress
isnull
.- Since:
- 2.12
-
create
public static SimpleServer create(java.net.URI address, javax.net.ssl.SSLContext context, SimpleContainer container, int count, int select) throws javax.ws.rs.ProcessingException
Create aCloseable
that registers anContainer
that in turn manages all root resource and provider classes found by searching the classes referenced in the java classpath.- Parameters:
address
- the URI to create the http server. The URI scheme must be equal tohttps
. The URI user information and host are ignored. If the URI port is not present then port 443 will be used. The URI path, query and fragment components are ignored.context
- this is the SSL context used for SSL connections.container
- the container that handles all HTTP requests.count
- this is the number of threads to be used.select
- this is the number of selector threads to use.- Returns:
- the closeable connection, with the endpoint started.
- Throws:
javax.ws.rs.ProcessingException
- thrown when problems during server creation.java.lang.IllegalArgumentException
- ifaddress
isnull
.
-
_create
private static SimpleServer _create(java.net.URI address, javax.net.ssl.SSLContext context, SimpleContainer container, UnsafeValue<org.simpleframework.transport.SocketProcessor,java.io.IOException> serverProvider) throws javax.ws.rs.ProcessingException
- Throws:
javax.ws.rs.ProcessingException
-
-