Class ArchiveDeployer
java.lang.Object
org.jboss.as.arquillian.container.ArchiveDeployer
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
ConstructorsConstructorDescriptionArchiveDeployer(ManagementClient client) Creates a new deployer for deploying archives.ArchiveDeployer(org.jboss.as.controller.client.ModelControllerClient modelControllerClient) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptiondeploy(String name, InputStream input) Deploys the archive to a running container.deploy(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.voidRemoves an archive from the running container.voidRemoves an archive from the running container.
-
Constructor Details
-
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
Creates a new deployer for deploying archives.- Parameters:
client- the management client to use
-
-
Method Details
-
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
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
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
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
-
ArchiveDeployer(ManagementClient)