Class CreateModuleServerSetupTask
- java.lang.Object
-
- org.jboss.as.arquillian.container.managed.setup.CreateModuleServerSetupTask
-
- All Implemented Interfaces:
ServerSetupTask
public abstract class CreateModuleServerSetupTask extends Object implements ServerSetupTask
A setup task which creates a module and deletes it when torn down. If deleting the module fails, likely to happen on Windows given the resources are in-use by the class loader, a shutdown hook will be added to delete the module after the JVM the tes is executing in terminates.- Author:
- James R. Perkins
-
-
Constructor Summary
Constructors Constructor Description CreateModuleServerSetupTask()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected voiddoSetup(ManagementClient managementClient, String containerId, Set<ModuleDescription> modules)Execute any necessary setup work that needs to happen before the first deployment to the given container.protected voiddoTearDown(ManagementClient managementClient, String containerId)Execute any tear down work that needs to happen after the last deployment associated with the given container has been undeployed.protected abstract Set<ModuleDescription>moduleDescriptions()The modules that should be created prior to a deployment.voidsetup(ManagementClient managementClient, String containerId)voidtearDown(ManagementClient managementClient, String containerId)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.as.arquillian.api.ServerSetupTask
executeOperation, executeOperation, executeOperation, executeOperation
-
-
-
-
Method Detail
-
setup
public final void setup(ManagementClient managementClient, String containerId) throws Exception
- Specified by:
setupin interfaceServerSetupTask- Throws:
Exception
-
tearDown
public final void tearDown(ManagementClient managementClient, String containerId) throws Exception
- Specified by:
tearDownin interfaceServerSetupTask- Throws:
Exception
-
doSetup
protected void doSetup(ManagementClient managementClient, String containerId, Set<ModuleDescription> modules) throws Exception
Execute any necessary setup work that needs to happen before the first deployment to the given container. If the server is in a state of reload-required, a reload will automatically be executed.- Parameters:
managementClient- management client to use to interact with the containercontainerId- id of the container to which the deployment will be deployedmodules- the build modules for this setup- Throws:
Exception- if a failure occurs- See Also:
setup(ManagementClient, String)
-
doTearDown
protected void doTearDown(ManagementClient managementClient, String containerId) throws Exception
Execute any tear down work that needs to happen after the last deployment associated with the given container has been undeployed. If the server is in a state of reload-required, a reload will automatically be executed.- Parameters:
managementClient- management client to use to interact with the containercontainerId- id of the container to which the deployment will be deployed- Throws:
Exception- if a failure occurs- See Also:
tearDown(ManagementClient, String)
-
moduleDescriptions
protected abstract Set<ModuleDescription> moduleDescriptions()
The modules that should be created prior to a deployment.- Returns:
- a set of modules to create
-
-