Class ServerSupport


  • public class ServerSupport
    extends java.lang.Object
    ServerSupport Helps configure the Server instance.
    • Constructor Detail

      • ServerSupport

        public ServerSupport()
    • Method Detail

      • configureDefaultConfigurationClasses

        public static void configureDefaultConfigurationClasses​(Server server)
      • configureHandlers

        public static void configureHandlers​(Server server,
                                             java.util.List<ContextHandler> contextHandlers,
                                             RequestLog requestLog)
                                      throws java.lang.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:
        java.lang.Exception
      • configureConnectors

        public static void configureConnectors​(Server server,
                                               Connector connector,
                                               java.util.Map<java.lang.String,​java.lang.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,
                                                  java.util.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 java.lang.Exception
        Add a WebAppContext to a Server
        Parameters:
        server - the server to use
        webapp - the webapp to add
        Throws:
        java.lang.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,
                                                    java.util.List<java.io.File> files,
                                                    java.util.Map<java.lang.String,​java.lang.String> properties)
                                             throws java.lang.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:
        java.lang.Exception - if unable to apply the xml configuration
      • applyXmlConfigurations

        public static Server applyXmlConfigurations​(Server server,
                                                    java.util.List<java.io.File> files)
                                             throws java.lang.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:
        java.lang.Exception