Class JettyRemoteDeployer

  • All Implemented Interfaces:
    Deployer, Loggable

    public class JettyRemoteDeployer
    extends AbstractRemoteDeployer
    A remote deployer for the Jetty container.

    NOTE: undeploy DELETES the webapp from the Jetty webapp directory.

    Limitations:
    • Will not undeploy files from anywhere other than the servers webapp directory
    • Cannot be used to undeploy webapps that were deployed using a xml context file in /contexts
    • Should not be used with multiple webapps sharing a common war
    • Constructor Detail

      • JettyRemoteDeployer

        public JettyRemoteDeployer​(RemoteContainer container)
        Remote deployer for the Jetty container.
        Parameters:
        container - The container used for deployment
    • Method Detail

      • createDefaultDeployerUrl

        protected String createDefaultDeployerUrl​(Configuration configuration)
        Returns a deployerURL based on default values.
        Parameters:
        configuration - The server configuration object
        Returns:
        The url for the deployer
      • undeploy

        public void undeploy​(Deployable deployable)
        Undeploy a Deployable from the running container. NOTE: THIS WILL DELETE THE WAR FROM THE WEBAPP DIRECTORY
        Specified by:
        undeploy in interface Deployer
        Overrides:
        undeploy in class AbstractDeployer
        Parameters:
        deployable - The deployable to be undeployed
      • invoke

        protected void invoke​(String path)
                       throws IOException
        Invokes Tomcat manager with the specified command.
        Parameters:
        path - the Tomcat manager command to invoke
        Throws:
        IOException - If there is an I/O issue communicating with the server
      • invoke

        protected String invoke​(String path,
                                File fileData)
                         throws IOException
        Invokes Jetty remote deployer web app with the specified command and content data.
        Parameters:
        path - the Jetty remote deployer web app command to invoke
        fileData - the file to stream as content data, if needed
        Returns:
        the result of the invoking command, as returned by the Jetty remote deployer web app
        Throws:
        IOException - If there is an I/O issue communicating with the server
      • lastLine

        protected String lastLine​(String string)
                           throws IOException
        Returns the last line of a string.
        Parameters:
        string - String of which to get the last line
        Returns:
        Last line of string
        Throws:
        IOException - if an i/o error occurs