Class GrizzlyHttpServerFactory
java.lang.Object
org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory
Factory for creating Grizzly Http Server.
Should you need to fine tune the underlying Grizzly transport layer, you can obtain direct access to the corresponding
Grizzly structures with server.getListener("grizzly").getTransport(). To make certain options take effect,
you need to work with an inactive HttpServer instance (that is the one that has not been started yet).
To obtain such an instance, use one of the below factory methods with start
parameter set to false
.
When the start
parameter is not present, the factory method returns an already started instance.
- Author:
- Pavel Bucek, Jakub Podlesak, Marek Potociar
- See Also:
-
HttpServer
GrizzlyHttpContainer
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri) Create newHttpServer
instance.static org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri, boolean start) Create newHttpServer
instance.static org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri, GrizzlyHttpContainer handler, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, boolean start) Create newHttpServer
instance.static org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri, ResourceConfig configuration) Create newHttpServer
instance.static org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri, ResourceConfig configuration, boolean start) Create newHttpServer
instance.static org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri, ResourceConfig configuration, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator) Create newHttpServer
instance.static org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri, ResourceConfig configuration, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, boolean start) Create newHttpServer
instance.static org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri, ResourceConfig config, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, Object parentContext) Create newHttpServer
instance.static org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri, ResourceConfig config, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, Object parentContext, boolean start) Create newHttpServer
instance.static org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri, ResourceConfig config, Object parentContext) Create newHttpServer
instance.static org.glassfish.grizzly.http.server.HttpServer
createHttpServer
(URI uri, ResourceConfig config, Object parentContext, boolean start) Create newHttpServer
instance.
-
Method Details
-
createHttpServer
Create newHttpServer
instance.- Parameters:
uri
- uri on which theApplicationHandler
will be deployed. Only first path segment will be used as context path, the rest will be ignored.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.
-
createHttpServer
Create newHttpServer
instance.- Parameters:
uri
- uri on which theApplicationHandler
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.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig configuration) Create newHttpServer
instance.- Parameters:
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.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig configuration, boolean start) Create newHttpServer
instance.- Parameters:
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.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig configuration, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator) Create newHttpServer
instance.- Parameters:
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.secure
- used for callNetworkListener.setSecure(boolean)
.sslEngineConfigurator
- Ssl settings to be passed toNetworkListener.setSSLEngineConfig(org.glassfish.grizzly.ssl.SSLEngineConfigurator)
.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig configuration, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, boolean start) Create newHttpServer
instance.- Parameters:
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.secure
- used for callNetworkListener.setSecure(boolean)
.sslEngineConfigurator
- Ssl settings to be passed toNetworkListener.setSSLEngineConfig(org.glassfish.grizzly.ssl.SSLEngineConfigurator)
.start
- if set to false, server will not get started, which allows to configure the underlying transport, see above for details.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig config, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, Object parentContext) Create newHttpServer
instance.- Parameters:
uri
- uri on which theApplicationHandler
will be deployed. Only first path segment will be used as context path, the rest will be ignored.config
- web application configuration.secure
- used for callNetworkListener.setSecure(boolean)
.sslEngineConfigurator
- Ssl settings to be passed toNetworkListener.setSSLEngineConfig(org.glassfish.grizzly.ssl.SSLEngineConfigurator)
.parentContext
- DI provider specific context with application's registered bindings.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.- Since:
- 2.12
- See Also:
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig config, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, Object parentContext, boolean start) Create newHttpServer
instance.- Parameters:
uri
- uri on which theApplicationHandler
will be deployed. Only first path segment will be used as context path, the rest will be ignored.config
- web application configuration.secure
- used for callNetworkListener.setSecure(boolean)
.sslEngineConfigurator
- Ssl settings to be passed toNetworkListener.setSSLEngineConfig(org.glassfish.grizzly.ssl.SSLEngineConfigurator)
.parentContext
- DI provider specific context with application's registered bindings.start
- if set to false, server will not get started, this allows end users to set additional properties on the underlying listener.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.- Since:
- 2.37
- See Also:
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig config, Object parentContext) Create newHttpServer
instance.- Parameters:
uri
- uri on which theApplicationHandler
will be deployed. Only first path segment will be used as context path, the rest will be ignored.config
- web application configuration.parentContext
- DI provider specific context with application's registered bindings.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.- Since:
- 2.12
- See Also:
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig config, Object parentContext, boolean start) Create newHttpServer
instance.- Parameters:
uri
- uri on which theApplicationHandler
will be deployed. Only first path segment will be used as context path, the rest will be ignored.config
- web application configuration.parentContext
- DI provider specific context with application's registered bindings.start
- if set to false, server will not get started, this allows end users to set additional properties on the underlying listener.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.- Since:
- 2.37
- See Also:
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, GrizzlyHttpContainer handler, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, boolean start) Create newHttpServer
instance.- Parameters:
uri
- uri on which theApplicationHandler
will be deployed. Only first path segment will be used as context path, the rest will be ignored.handler
-HttpHandler
instance.secure
- used for callNetworkListener.setSecure(boolean)
.sslEngineConfigurator
- Ssl settings to be passed toNetworkListener.setSSLEngineConfig(org.glassfish.grizzly.ssl.SSLEngineConfigurator)
.start
- if set to false, server will not get started, this allows end users to set additional properties on the underlying listener.- Returns:
- newly created
HttpServer
. - Throws:
ProcessingException
- in case of any failure when creating a newHttpServer
instance.- See Also:
-