Class ServerSupport

java.lang.Object
org.eclipse.jetty.maven.plugin.ServerSupport

public class ServerSupport extends Object
ServerSupport Helps configure the Server instance.
  • Constructor Details

    • ServerSupport

      public ServerSupport()
  • Method Details

    • configureDefaultConfigurationClasses

      public static void configureDefaultConfigurationClasses(Server server)
    • configureHandlers

      public static void configureHandlers(Server server, List<ContextHandler> contextHandlers, RequestLog requestLog) throws Exception
      Set up the handler structure to receive a webapp. Also put in a DefaultHandler so we get a nicer page than a 404 if we hit the root and the webapp's context isn't at root.
      Parameters:
      server - the server to use
      contextHandlers - the context handlers to include
      requestLog - a request log to use
      Throws:
      Exception
    • configureConnectors

      public static void configureConnectors(Server server, Connector connector, Map<String,String> properties)
      Configure at least one connector for the server
      Parameters:
      server - the server
      connector - the connector
      properties - jetty properties
    • configureLoginServices

      public static void configureLoginServices(Server server, List<LoginService> loginServices)
      Set up any security LoginServices provided.
      Parameters:
      server - the server
      loginServices - the login services
    • addWebApplication

      public static void addWebApplication(Server server, WebAppContext webapp) throws Exception
      Add a WebAppContext to a Server
      Parameters:
      server - the server to use
      webapp - the webapp to add
      Throws:
      Exception
    • findContextHandlerCollection

      public static ContextHandlerCollection findContextHandlerCollection(Server server)
      Locate a ContextHandlerCollection for a Server.
      Parameters:
      server - the Server to check.
      Returns:
      The ContextHandlerCollection or null if not found.
    • applyXmlConfigurations

      public static Server applyXmlConfigurations(Server server, List<File> files, Map<String,String> properties) throws Exception
      Apply xml files to server instance.
      Parameters:
      server - the server to apply the xml to
      files - the list of xml files
      properties - list of jetty properties
      Returns:
      the Server implementation, after the xml is applied
      Throws:
      Exception - if unable to apply the xml configuration
    • applyXmlConfigurations

      public static Server applyXmlConfigurations(Server server, List<File> files) throws Exception
      Apply xml files to server instance.
      Parameters:
      server - the Server instance to configure
      files - the xml configs to apply
      Returns:
      the Server after application of configs
      Throws:
      Exception