Class JettyServerManager

  • All Implemented Interfaces:
    ServerManager

    public class JettyServerManager
    extends java.lang.Object
    implements ServerManager
    Implementation of the ServerManager interface for managing Jetty servers.

    This class only deals with a specific handler structure. The uppermost handler must be a HandlerCollection and we add the deployment to all of it's appropriate childhandlers.

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addServer​(org.eclipse.jetty.server.Server server)  
      void addServlet​(javax.servlet.Servlet servlet, java.util.HashMap<java.lang.String,​java.lang.Object> additionalProperties)
      Method for adding a servlet to the server(s).
      void addServlet​(org.eclipse.jetty.servlet.ServletHolder servlet, java.util.HashMap<java.lang.String,​java.lang.Object> additionalProperties)  
      boolean isStarted()
      Query whether or not the underlying webserver is started or not.
      void removeDeployment​(java.lang.String contextPath)
      Method for removing a deployment from the server(s).
      void removeDeployment​(org.eclipse.jetty.servlet.ServletHolder holder, java.lang.String path)  
      void removeServer​(org.eclipse.jetty.server.Server server)  
      void startDeployment​(java.lang.String contextPath)
      If for any reason a deployment should be started.
      void stopDeployment​(java.lang.String contextPath)
      If for any reason a deployment should be stopped.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • DEFAULT_DESCRIPTOR_XML

        public static final java.lang.String DEFAULT_DESCRIPTOR_XML
        See Also:
        Constant Field Values
      • DEFAULT_JETTY_XML

        public static final java.lang.String DEFAULT_JETTY_XML
        See Also:
        Constant Field Values
      • SYS_PROP_THROW_UNAVAILABLE_EXCEPTION

        public static final java.lang.String SYS_PROP_THROW_UNAVAILABLE_EXCEPTION
        System property that controls whether or not starting the WebAppContext should throw an exception or not.

        The default is false for backwards compatibility; but can be toggled to true; it will be defaulted to true in a future release.

        See Also:
        Constant Field Values
      • SECURITY_CONSTRAINTS

        public static final java.lang.String SECURITY_CONSTRAINTS
        See Also:
        Constant Field Values
      • JETTY_DEBUG

        public static final boolean JETTY_DEBUG
        Enable additional debug logging by specifying the system property interlok.jetty.debug to true.
    • Constructor Detail

      • JettyServerManager

        public JettyServerManager()
    • Method Detail

      • addServer

        public void addServer​(org.eclipse.jetty.server.Server server)
      • removeServer

        public void removeServer​(org.eclipse.jetty.server.Server server)
      • isStarted

        public boolean isStarted()
        Description copied from interface: ServerManager
        Query whether or not the underlying webserver is started or not.
        Specified by:
        isStarted in interface ServerManager
        Returns:
        true if the underlying webserver is started.
      • addServlet

        public void addServlet​(javax.servlet.Servlet servlet,
                               java.util.HashMap<java.lang.String,​java.lang.Object> additionalProperties)
                        throws java.lang.Exception
        Description copied from interface: ServerManager
        Method for adding a servlet to the server(s).
        Specified by:
        addServlet in interface ServerManager
        Parameters:
        servlet - - The servlet to be added to the server.
        additionalProperties - - Additional properties needed for the deployment.
        Throws:
        java.lang.Exception - on exception.
      • addServlet

        public void addServlet​(org.eclipse.jetty.servlet.ServletHolder servlet,
                               java.util.HashMap<java.lang.String,​java.lang.Object> additionalProperties)
                        throws java.lang.Exception
        Throws:
        java.lang.Exception
      • removeDeployment

        public void removeDeployment​(java.lang.String contextPath)
                              throws java.lang.Exception
        Description copied from interface: ServerManager
        Method for removing a deployment from the server(s). Basically this is for removing a deployment during runtime.
        Specified by:
        removeDeployment in interface ServerManager
        Parameters:
        contextPath - - The context path of the deployment.
        Throws:
        java.lang.Exception - on exception.
      • removeDeployment

        public void removeDeployment​(org.eclipse.jetty.servlet.ServletHolder holder,
                                     java.lang.String path)
                              throws java.lang.Exception
        Throws:
        java.lang.Exception
      • startDeployment

        public void startDeployment​(java.lang.String contextPath)
                             throws java.lang.Exception
        Description copied from interface: ServerManager
        If for any reason a deployment should be started.
        Specified by:
        startDeployment in interface ServerManager
        Throws:
        java.lang.Exception - on exception.
      • stopDeployment

        public void stopDeployment​(java.lang.String contextPath)
                            throws java.lang.Exception
        Description copied from interface: ServerManager
        If for any reason a deployment should be stopped.
        Specified by:
        stopDeployment in interface ServerManager
        Throws:
        java.lang.Exception - on exception.