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,
                                             RequestLog requestLog)
                                      throws java.lang.Exception
        Set up the handler structure to receive a webapp. Also put in a DefaultHandler so we get a nice page than a 404 if we hit the root and the webapp's context isn't at root.
        Parameters:
        server - the server
        requestLog - the request log
        Throws:
        java.lang.Exception - if unable to configure the handlers
      • configureConnectors

        public static void configureConnectors​(Server server,
                                               Connector connector)
        Configure at least one connector for the server
        Parameters:
        server - the server
        connector - the connector
      • configureLoginServices

        public static void configureLoginServices​(Server server,
                                                  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
        Throws:
        java.lang.Exception
      • 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 - if unable to apply the xml configuration