FileDocCategorySizeDatePackage
StartAppservCommand.javaAPI DocGlassfish v2 API4986Fri May 04 22:25:12 BST 2007com.sun.enterprise.cli.commands

StartAppservCommand

public class StartAppservCommand extends StartDomainCommand
Starts all the domains in the specified/default domaindir
version
$Revision: 1.4 $

Fields Summary
Constructors Summary
Methods Summary
public voidrunCommand()
An abstract method that Executes the command

throws
CommandException

        
        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 allDomainsStarted = true;

        if (domainsList.length == 0)
            throw new CommandException(getLocalizedString("NoDomainsToStart"));
        else
            CLILogger.getInstance().printDetailMessage(getLocalizedString("StartingAppserv",
                                                             new Object[] {getDomainsRoot()}));
        
        for (int i = 0; i < domainsList.length; i++)
        {
            try
            {
                startDomain(domainsList[i]);
            }
            catch(Exception e)
            {
                allDomainsStarted = false;
                CLILogger.getInstance().printDetailMessage(e.getLocalizedMessage());
                CLILogger.getInstance().printExceptionStackTrace(e);
                CLILogger.getInstance().printError(getLocalizedString("CannotStartDomainMsg",
                                                       new Object[] {domainsList[i]}));
            }
        }
        if (!allDomainsStarted)
        {
            throw new CommandException(getLocalizedString("CannotStartOneOrMoreDomains"));

        }
    
public booleanvalidateOptions()
An abstract method that validates the options on the specification in the xml properties file This method verifies for the correctness of number of operands and if all the required options are supplied by the client.

return
boolean returns true if success else returns false

    	return super.validateOptions();