Sun Java System Application Server Platform Edition 8.1 2005Q2 Update 2 Developer's Guide

- Previous: Monitoring Attribute Changes
- Next: Stopping an Application Server

## Undeploying Modules

The `undeploy()` method demonstrates how to undeploy a module.

##### Example 16–14 Undeploying Modules

    [...]
    undeploy ( final String moduleName ) throws IOException
    {
        final DeploymentMgr mgr = getDomainRoot().getDeploymentMgr();

        final Map statusData = mgr.undeploy( moduleName, null );
        final DeploymentStatus status =
            DeploymentSupport.mapToDeploymentStatus( statusData );
        println( "Undeployment result: "
            + getStageStatusString(status.getStageStatus()));
        if ( status.getStageThrowable() != null )
        {
            status.getStageThrowable().printStackTrace();
        }
    }
    [...]

The `undeploy()` method obtains the `DeploymentMgr` instance for the domain in the same way that `deploy()` does so. It then calls the `DeploymentMgr.undeploy()` method for a named module.

- Previous: Monitoring Attribute Changes
- Next: Stopping an Application Server

- © 2010, Oracle Corporation and/or its affiliates