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:
-
HttpServerGrizzlyHttpContainer
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri) Create newHttpServerinstance.static org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri, boolean start) Create newHttpServerinstance.static org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri, GrizzlyHttpContainer handler, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, boolean start) Create newHttpServerinstance.static org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri, ResourceConfig configuration) Create newHttpServerinstance.static org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri, ResourceConfig configuration, boolean start) Create newHttpServerinstance.static org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri, ResourceConfig configuration, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator) Create newHttpServerinstance.static org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri, ResourceConfig configuration, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, boolean start) Create newHttpServerinstance.static org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri, ResourceConfig config, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, Object parentContext) Create newHttpServerinstance.static org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri, ResourceConfig config, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, Object parentContext, boolean start) Create newHttpServerinstance.static org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri, ResourceConfig config, Object parentContext) Create newHttpServerinstance.static org.glassfish.grizzly.http.server.HttpServercreateHttpServer(URI uri, ResourceConfig config, Object parentContext, boolean start) Create newHttpServerinstance.
-
Method Details
-
createHttpServer
Create newHttpServerinstance.- Parameters:
uri- uri on which theApplicationHandlerwill 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 newHttpServerinstance.
-
createHttpServer
Create newHttpServerinstance.- Parameters:
uri- uri on which theApplicationHandlerwill 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 newHttpServerinstance.
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig configuration) Create newHttpServerinstance.- 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 newHttpServerinstance.
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig configuration, boolean start) Create newHttpServerinstance.- 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 newHttpServerinstance.
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig configuration, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator) Create newHttpServerinstance.- 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 newHttpServerinstance.
-
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 newHttpServerinstance.- 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 newHttpServerinstance.
-
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 newHttpServerinstance.- Parameters:
uri- uri on which theApplicationHandlerwill 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 newHttpServerinstance.- 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 newHttpServerinstance.- Parameters:
uri- uri on which theApplicationHandlerwill 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 newHttpServerinstance.- Since:
- 2.37
- See Also:
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig config, Object parentContext) Create newHttpServerinstance.- Parameters:
uri- uri on which theApplicationHandlerwill 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 newHttpServerinstance.- Since:
- 2.12
- See Also:
-
createHttpServer
public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig config, Object parentContext, boolean start) Create newHttpServerinstance.- Parameters:
uri- uri on which theApplicationHandlerwill 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 newHttpServerinstance.- 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 newHttpServerinstance.- Parameters:
uri- uri on which theApplicationHandlerwill be deployed. Only first path segment will be used as context path, the rest will be ignored.handler-HttpHandlerinstance.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 newHttpServerinstance.- See Also:
-