Sun Java System Application Server Enterprise Edition 8.2 Developer's Guide

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 )

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.