Class 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 Detail

      • CreateModuleServerSetupTask

        public CreateModuleServerSetupTask()
    • Method Detail

      • 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 container
        containerId - id of the container to which the deployment will be deployed
        modules - 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 container
        containerId - 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