Class WebServerFactory

java.lang.Object
org.glassfish.jersey.server.WebServerFactory

public final class WebServerFactory extends Object
Factory for creating specific HTTP servers.
Since:
3.1.0
Author:
Markus KARG (markus@headcrashing.eu)
  • Method Details

    • createServer

      public static <T extends WebServer> T createServer(Class<T> type, Application application, SeBootstrap.Configuration configuration)
      Creates a server of a given type which runs the given application using the given bootstrap configuration.

      The list of service-providers supporting the WebServerProvider service-provider will be iterated over until one returns a non-null server instance.

      Type Parameters:
      T - the type of the server.
      Parameters:
      type - the type of the server. Providers SHOULD support at least WebServer.
      application - The application to host.
      configuration - The configuration (host, port, etc.) to be used for bootstrapping.
      Returns:
      the created server.
      Throws:
      ProcessingException - if there is an error creating the server.
      IllegalArgumentException - if no server provider supports the type.
    • createServer

      public static <T extends WebServer> T createServer(Class<T> type, Class<? extends Application> application, SeBootstrap.Configuration configuration)
      Creates a server of a given type which runs the given application using the given bootstrap configuration.

      The list of service-providers supporting the WebServerProvider service-provider will be iterated over until one returns a non-null server instance.

      Type Parameters:
      T - the type of the server.
      Parameters:
      type - the type of the server. Providers SHOULD support at least WebServer.
      application - The application to host.
      configuration - The configuration (host, port, etc.) to be used for bootstrapping.
      Returns:
      the created server.
      Throws:
      ProcessingException - if there is an error creating the server.
      IllegalArgumentException - if no server provider supports the type.