Class ArchiveDeployer


  • public class ArchiveDeployer
    extends Object
    Allows deployment operations to be executed on a running server.

    The client is not closed by an instance of this and is the responsibility of the user to clean up the client instance.

    Since:
    17-Nov-2010
    Author:
    Thomas.Diesler@jboss.com, James R. Perkins
    • Constructor Detail

      • ArchiveDeployer

        @Deprecated
        public ArchiveDeployer​(org.jboss.as.controller.client.ModelControllerClient modelControllerClient)
        Creates a new deployer for deploying archives.

        Using this constructor the state of the client connection cannot be validated. This could produce unexpected results if the client is closed and there's an attempt to use an instance of this type.

        Parameters:
        modelControllerClient - the model controller to use
      • ArchiveDeployer

        public ArchiveDeployer​(ManagementClient client)
        Creates a new deployer for deploying archives.
        Parameters:
        client - the management client to use
    • Method Detail

      • deploy

        public String deploy​(org.jboss.shrinkwrap.api.Archive<?> archive)
                      throws org.jboss.arquillian.container.spi.client.container.DeploymentException
        Deploys the archive to a running container.
        Parameters:
        archive - the archive to deploy
        Returns:
        the runtime name of the deployment
        Throws:
        org.jboss.arquillian.container.spi.client.container.DeploymentException - if an error happens during deployment
        IllegalStateException - if the client has been closed
      • deploy

        public String deploy​(String name,
                             InputStream input)
                      throws org.jboss.arquillian.container.spi.client.container.DeploymentException
        Deploys the archive to a running container.
        Parameters:
        name - the runtime for the deployment
        input - the input stream of a deployment archive
        Returns:
        the runtime name of the deployment
        Throws:
        org.jboss.arquillian.container.spi.client.container.DeploymentException - if an error happens during deployment
        IllegalStateException - if the client has been closed
      • undeploy

        public void undeploy​(String runtimeName)
        Removes an archive from the running container.

        All exceptions are caught and logged as a warning. Errors will still be thrown however.

        Parameters:
        runtimeName - the runtime name for the deployment
      • undeploy

        public void undeploy​(String runtimeName,
                             boolean failOnMissing)
        Removes an archive from the running container.

        All exceptions are caught and logged as a warning. Errors will still be thrown however.

        Parameters:
        runtimeName - the runtime name for the deployment
        failOnMissing - true if the undeploy should fail if the deployment was not found on the server, false if the deployment does not exist and the undeploy should be ignored
      • hasDeployment

        public boolean hasDeployment​(String name)
                              throws IOException
        Checks if the deployment content is on the server.
        Parameters:
        name - the name of the deployment
        Returns:
        true if the deployment content exists otherwise false
        Throws:
        IOException - if a failure occurs communicating with the server