An abstract method that Executes the command
CLILogger.getInstance().printWarning(getLocalizedString("CommandDeprecated",
new Object[] {name}));
validateOptions();
String[] domainsList = null;
try
{
DomainConfig domainConfig = new DomainConfig(null, getDomainsRoot());
DomainsManager manager = getFeatureFactory().getDomainsManager();
domainsList = manager.listDomains(domainConfig);
}
catch(Exception e)
{
throw new CommandException(getLocalizedString("CommandUnSuccessful",
new Object[] {name} ), e);
}
boolean allDomainsStopped = true;
if (domainsList.length == 0)
throw new CommandException(getLocalizedString("NoDomainsToStop"));
else
CLILogger.getInstance().printDetailMessage(getLocalizedString("StoppingAppserv",
new Object[] {getDomainsRoot()}));
for (int i = 0; i < domainsList.length; i++)
{
try
{
stopDomain(domainsList[i]);
}
catch(Exception e)
{
allDomainsStopped = false;
CLILogger.getInstance().printDetailMessage(e.getLocalizedMessage());
CLILogger.getInstance().printExceptionStackTrace(e);
CLILogger.getInstance().printError(getLocalizedString("CannotStopDomainMsg",
new Object[] {domainsList[i]}));
}
}
if (!allDomainsStopped)
{
throw new CommandException(getLocalizedString("CannotStopOneOrMoreDomains"));
}