Sun GlassFish Enterprise Server v3 Embedded Server Guide

Undeploying an Application

Undeploy an application when the application is no longer required to run in Enterprise Server. For example, before stopping Enterprise Server, undeploy all applications that are running in Enterprise Server.

To undeploy an application, invoke the undeploy method of an existing EmbeddedDeployer object. In the method invocation, pass the name of the application and the name of its DeployCommandParameters class as parameters. Both are specified when the application is deployed.

To undeploy all deployed applications, invoke the undeployAll method of an existing EmbeddedDeployer object. This method takes no parameters.


Example 7 Undeploying an Application

This example shows code for undeploying the application that was deployed in Example 6.

...
import org.glassfish.api.deployment.*;
...
import org.glassfish.api.embedded.*;
...
    deployer.undeploy(war, params);
...