public void stop(Context context) throws LifecycleException
{
Server server = manager.getServer(configuration.getProfileName());
if(!server.isRunning())
{
throw new LifecycleException("Can not stop server. Server is not started");
}
try
{
removeFailedUnDeployments();
}
catch (Exception e)
{
throw new LifecycleException("Could not clean up failed undeployments", e);
}
try
{
manager.stopServer(server.getName());
}
catch (Exception e)
{
throw new LifecycleException("Could not stop server", e);
}
}