Class JettyDeployerJetty

    • Constructor Detail

      • JettyDeployerJetty

        protected JettyDeployerJetty​(Object context)
        Creates the Jetty deployer.
        Parameters:
        context - current web application context
    • Method Detail

      • getServer

        protected abstract org.eclipse.jetty.server.Server getServer()
        Returns the current Jetty server.
        Returns:
        Jetty server
      • getEnvironmentName

        protected abstract String getEnvironmentName()
        Returns the Jetty environment name used by this deployer.
        Returns:
        environment name
      • getContextPath

        protected abstract String getContextPath​(Object contextHandler)
        Returns the context path of a web application.
        Parameters:
        contextHandler - web application context
        Returns:
        context path
      • isWebAppContext

        protected abstract boolean isWebAppContext​(org.eclipse.jetty.server.Handler handler)
        Determines whether an object is a web application context.
        Parameters:
        handler - Jetty handler
        Returns:
        true if the handler is a web application context
      • getStandardDeployer

        protected org.eclipse.jetty.deploy.StandardDeployer getStandardDeployer()
        Returns the Jetty StandardDeployer.

        The deployer is normally installed in the server's component tree. The contained-bean lookup is also used because a DeploymentScanner may own the deployer.

        Returns:
        StandardDeployer
      • getContextHandlerCollection

        protected org.eclipse.jetty.server.handler.ContextHandlerCollection getContextHandlerCollection()
        Returns the Jetty context handler collection used by the deployer.
        Returns:
        context handler collection
      • deployWebApp

        protected void deployWebApp​(String contextPath,
                                    File warFile)
                             throws Exception
        Deploys a WAR.

        The context is deliberately created through StandardContextHandlerFactory. This is important in Jetty 12.1 because the factory creates and configures the web application using the appropriate Jetty environment and environment classloader.

        Parameters:
        contextPath - context path
        warFile - WAR file
        Throws:
        Exception - if deployment fails
      • undeployWebApp

        protected String undeployWebApp​(Object contextHandler)
                                 throws Exception
        Undeploys a web application.
        Parameters:
        contextHandler - web application context
        Returns:
        WAR location
        Throws:
        Exception - if undeployment fails
      • getContext

        protected Object getContext()
        Returns the current web application context.
        Returns:
        current web application context