Class GrizzlyHttpServerFactory

java.lang.Object
org.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpServerFactory

public final class GrizzlyHttpServerFactory extends Object
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:
  • Method Summary

    Modifier and Type
    Method
    Description
    static org.glassfish.grizzly.http.server.HttpServer
    Create new HttpServer instance.
    static org.glassfish.grizzly.http.server.HttpServer
    createHttpServer(URI uri, boolean start)
    Create new HttpServer instance.
    static org.glassfish.grizzly.http.server.HttpServer
    createHttpServer(URI uri, GrizzlyHttpContainer handler, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, boolean start)
    Create new HttpServer instance.
    static org.glassfish.grizzly.http.server.HttpServer
    createHttpServer(URI uri, ResourceConfig configuration)
    Create new HttpServer instance.
    static org.glassfish.grizzly.http.server.HttpServer
    createHttpServer(URI uri, ResourceConfig configuration, boolean start)
    Create new HttpServer instance.
    static org.glassfish.grizzly.http.server.HttpServer
    createHttpServer(URI uri, ResourceConfig configuration, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator)
    Create new HttpServer instance.
    static org.glassfish.grizzly.http.server.HttpServer
    createHttpServer(URI uri, ResourceConfig configuration, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, boolean start)
    Create new HttpServer instance.
    static org.glassfish.grizzly.http.server.HttpServer
    createHttpServer(URI uri, ResourceConfig config, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator, Object parentContext)
    Create new HttpServer 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 new HttpServer instance.
    static org.glassfish.grizzly.http.server.HttpServer
    createHttpServer(URI uri, ResourceConfig config, Object parentContext)
    Create new HttpServer instance.
    static org.glassfish.grizzly.http.server.HttpServer
    createHttpServer(URI uri, ResourceConfig config, Object parentContext, boolean start)
    Create new HttpServer instance.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • createHttpServer

      public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri)
      Create new HttpServer instance.
      Parameters:
      uri - uri on which the ApplicationHandler 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 new HttpServer instance.
    • createHttpServer

      public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, boolean start)
      Create new HttpServer instance.
      Parameters:
      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.
      Returns:
      newly created HttpServer.
      Throws:
      ProcessingException - in case of any failure when creating a new HttpServer instance.
    • createHttpServer

      public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig configuration)
      Create new HttpServer 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 new HttpServer instance.
    • createHttpServer

      public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig configuration, boolean start)
      Create new HttpServer 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 new HttpServer instance.
    • createHttpServer

      public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig configuration, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator)
      Create new HttpServer 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 call NetworkListener.setSecure(boolean).
      sslEngineConfigurator - Ssl settings to be passed to NetworkListener.setSSLEngineConfig(org.glassfish.grizzly.ssl.SSLEngineConfigurator).
      Returns:
      newly created HttpServer.
      Throws:
      ProcessingException - in case of any failure when creating a new HttpServer 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 new HttpServer 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 call NetworkListener.setSecure(boolean).
      sslEngineConfigurator - Ssl settings to be passed to NetworkListener.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 new HttpServer 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 new HttpServer instance.
      Parameters:
      uri - uri on which the ApplicationHandler 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 call NetworkListener.setSecure(boolean).
      sslEngineConfigurator - Ssl settings to be passed to NetworkListener.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 new HttpServer 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 new HttpServer instance.
      Parameters:
      uri - uri on which the ApplicationHandler 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 call NetworkListener.setSecure(boolean).
      sslEngineConfigurator - Ssl settings to be passed to NetworkListener.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 new HttpServer instance.
      Since:
      2.37
      See Also:
    • createHttpServer

      public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI uri, ResourceConfig config, Object parentContext)
      Create new HttpServer instance.
      Parameters:
      uri - uri on which the ApplicationHandler 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 new HttpServer 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 new HttpServer instance.
      Parameters:
      uri - uri on which the ApplicationHandler 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 new HttpServer 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 new HttpServer instance.
      Parameters:
      uri - uri on which the ApplicationHandler will be deployed. Only first path segment will be used as context path, the rest will be ignored.
      handler - HttpHandler instance.
      secure - used for call NetworkListener.setSecure(boolean).
      sslEngineConfigurator - Ssl settings to be passed to NetworkListener.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 new HttpServer instance.
      See Also: