The undeploy() method demonstrates how to undeploy a module.
[...] 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.