public final class JettyHttpContainerFactory extends Object
Server
instances, which allows
the server to be stopped by invoking the AbstractLifeCycle.stop()
method.
To start the server in HTTPS mode an SslContextFactory
can be provided.
This will be used to decrypt and encrypt information sent over the
connected TCP socket channel.Modifier and Type | Method and Description |
---|---|
static org.eclipse.jetty.server.Server |
createServer(URI uri)
Creates a
Server instance that registers an Handler . |
static org.eclipse.jetty.server.Server |
createServer(URI uri,
boolean start)
Creates a
Server instance that registers an Handler . |
static org.eclipse.jetty.server.Server |
createServer(URI uri,
ResourceConfig config)
Create a
Server that registers an Handler that
in turn manages all root resource and provider classes declared by the
resource configuration. |
static org.eclipse.jetty.server.Server |
createServer(URI uri,
ResourceConfig configuration,
boolean start)
Create a
Server that registers an Handler that
in turn manages all root resource and provider classes declared by the
resource configuration. |
static org.eclipse.jetty.server.Server |
createServer(URI uri,
ResourceConfig config,
boolean start,
org.glassfish.hk2.api.ServiceLocator parentLocator)
Create a
Server that registers an Handler that
in turn manages all root resource and provider classes declared by the
resource configuration. |
static org.eclipse.jetty.server.Server |
createServer(URI uri,
ResourceConfig config,
org.glassfish.hk2.api.ServiceLocator parentLocator)
Create a
Server that registers an Handler that
in turn manages all root resource and provider classes declared by the
resource configuration. |
static org.eclipse.jetty.server.Server |
createServer(URI uri,
org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory,
JettyHttpContainer handler,
boolean start)
Create a
Server that registers an Handler that
in turn manages all root resource and provider classes found by searching the
classes referenced in the java classpath. |
static org.eclipse.jetty.server.Server |
createServer(URI uri,
org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory,
ResourceConfig config)
Create a
Server that registers an Handler that
in turn manages all root resource and provider classes declared by the
resource configuration. |
public static org.eclipse.jetty.server.Server createServer(URI uri) throws javax.ws.rs.ProcessingException
Server
instance that registers an Handler
.uri
- uri on which the ApplicationHandler
will be deployed. Only first path
segment will be used as context path, the rest will be ignored.Server
.javax.ws.rs.ProcessingException
- in case of any failure when creating a new Jetty Server
instance.IllegalArgumentException
- if uri
is null
.public static org.eclipse.jetty.server.Server createServer(URI uri, boolean start) throws javax.ws.rs.ProcessingException
Server
instance that registers an Handler
.uri
- uri on which the ApplicationHandler
will be deployed. Only first path
segment will be used as context path, the rest will be ignored.start
- if set to false, server will not get started, which allows to configure the underlying transport
layer, see above for details.Server
.javax.ws.rs.ProcessingException
- in case of any failure when creating a new Jetty Server
instance.IllegalArgumentException
- if uri
is null
.public static org.eclipse.jetty.server.Server createServer(URI uri, ResourceConfig config) throws javax.ws.rs.ProcessingException
Server
that registers an Handler
that
in turn manages all root resource and provider classes declared by the
resource configuration.
This implementation defers to the
ContainerFactory.createContainer(Class, javax.ws.rs.core.Application)
method
for creating an Container that manages the root resources.uri
- 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.Server
.javax.ws.rs.ProcessingException
- in case of any failure when creating a new Jetty Server
instance.IllegalArgumentException
- if uri
is null
.public static org.eclipse.jetty.server.Server createServer(URI uri, ResourceConfig configuration, boolean start) throws javax.ws.rs.ProcessingException
Server
that registers an Handler
that
in turn manages all root resource and provider classes declared by the
resource configuration.
This implementation defers to the
ContainerFactory.createContainer(Class, javax.ws.rs.core.Application)
method
for creating an Container that manages the root resources.uri
- URI on which the Jersey web application will be deployed. Only first path segment will be
used as context path, the rest will be ignored.configuration
- web application configuration.start
- if set to false, server will not get started, which allows to configure the underlying
transport layer, see above for details.Server
.javax.ws.rs.ProcessingException
- in case of any failure when creating a new Jetty Server
instance.IllegalArgumentException
- if uri
is null
.public static org.eclipse.jetty.server.Server createServer(URI uri, ResourceConfig config, boolean start, org.glassfish.hk2.api.ServiceLocator parentLocator)
Server
that registers an Handler
that
in turn manages all root resource and provider classes declared by the
resource configuration.uri
- the URI to create the http server. The URI scheme must be
equal to "https". The URI user information and host
are ignored If the URI port is not present then port 143 will be
used. The URI path, query and fragment components are ignored.config
- the resource configuration.parentLocator
- ServiceLocator
to become a parent of the locator used by
ApplicationHandler
start
- if set to false, server will not get started, this allows end users to set
additional properties on the underlying listener.Server
.javax.ws.rs.ProcessingException
- in case of any failure when creating a new Jetty Server
instance.IllegalArgumentException
- if uri
is null
.JettyHttpContainer
,
ServiceLocator
public static org.eclipse.jetty.server.Server createServer(URI uri, ResourceConfig config, org.glassfish.hk2.api.ServiceLocator parentLocator)
Server
that registers an Handler
that
in turn manages all root resource and provider classes declared by the
resource configuration.uri
- the URI to create the http server. The URI scheme must be
equal to "https". The URI user information and host
are ignored If the URI port is not present then port 143 will be
used. The URI path, query and fragment components are ignored.config
- the resource configuration.parentLocator
- ServiceLocator
to become a parent of the locator used by
ApplicationHandler
Server
.javax.ws.rs.ProcessingException
- in case of any failure when creating a new Jetty Server
instance.IllegalArgumentException
- if uri
is null
.JettyHttpContainer
,
ServiceLocator
public static org.eclipse.jetty.server.Server createServer(URI uri, org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory, ResourceConfig config) throws javax.ws.rs.ProcessingException
Server
that registers an Handler
that
in turn manages all root resource and provider classes declared by the
resource configuration.
This implementation defers to the
ContainerFactory.createContainer(Class, javax.ws.rs.core.Application)
method
for creating an Container that manages the root resources.uri
- the URI to create the http server. The URI scheme must be
equal to https
. 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.sslContextFactory
- this is the SSL context factory used to configure SSL connectorconfig
- the resource configuration.Server
.javax.ws.rs.ProcessingException
- in case of any failure when creating a new Jetty Server
instance.IllegalArgumentException
- if uri
is null
.public static org.eclipse.jetty.server.Server createServer(URI uri, org.eclipse.jetty.util.ssl.SslContextFactory sslContextFactory, JettyHttpContainer handler, boolean start)
Server
that registers an Handler
that
in turn manages all root resource and provider classes found by searching the
classes referenced in the java classpath.uri
- the URI to create the http server. The URI scheme must be
equal to https
. 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.sslContextFactory
- this is the SSL context factory used to configure SSL connectorhandler
- the container that handles all HTTP requestsstart
- if set to false, server will not get started, this allows end users to set
additional properties on the underlying listener.Server
.javax.ws.rs.ProcessingException
- in case of any failure when creating a new Jetty Server
instance.IllegalArgumentException
- if uri
is null
.JettyHttpContainer
Copyright © 2007-2015, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.