Class ArchiveDeployer
- java.lang.Object
-
- org.jboss.as.arquillian.container.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 Summary
Constructors Constructor Description ArchiveDeployer(ManagementClient client)Creates a new deployer for deploying archives.ArchiveDeployer(org.jboss.as.controller.client.ModelControllerClient modelControllerClient)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringdeploy(String name, InputStream input)Deploys the archive to a running container.Stringdeploy(org.jboss.shrinkwrap.api.Archive<?> archive)Deploys the archive to a running container.booleanhasDeployment(String name)Checks if the deployment content is on the server.voidundeploy(String runtimeName)Removes an archive from the running container.voidundeploy(String runtimeName, boolean failOnMissing)Removes an archive from the running container.
-
-
-
Constructor Detail
-
ArchiveDeployer
@Deprecated public ArchiveDeployer(org.jboss.as.controller.client.ModelControllerClient modelControllerClient)
Deprecated.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 deploymentIllegalStateException- 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 deploymentinput- 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 deploymentIllegalStateException- 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.
Errorswill 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.
Errorswill still be thrown however.- Parameters:
runtimeName- the runtime name for the deploymentfailOnMissing-trueif the undeploy should fail if the deployment was not found on the server,falseif 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:
trueif the deployment content exists otherwisefalse- Throws:
IOException- if a failure occurs communicating with the server
-
-