com.sun.enterprise.admin.cli
Class StopDomainCommand

java.lang.Object
  extended by com.sun.enterprise.admin.cli.CLICommand
      extended by com.sun.enterprise.admin.cli.LocalServerCommand
          extended by com.sun.enterprise.admin.cli.LocalDomainCommand
              extended by com.sun.enterprise.admin.cli.StopDomainCommand
All Implemented Interfaces:
org.jvnet.hk2.component.PostConstruct
Direct Known Subclasses:
RestartDomainCommand

@Service(name="stop-domain")
@Scoped(value=org.jvnet.hk2.component.PerLookup.class)
public class StopDomainCommand
extends LocalDomainCommand

The stop-domain command.

Author:
Byron Nevins, Bill Shannon

Field Summary
(package private)  java.lang.Boolean force
           
(package private)  java.lang.Boolean kill
           
private  boolean local
           
private  java.lang.String userArgDomainName
           
private static long WAIT_FOR_DAS_TIME_MS
           
 
Fields inherited from class com.sun.enterprise.admin.cli.LocalDomainCommand
domainDirParam
 
Fields inherited from class com.sun.enterprise.admin.cli.CLICommand
argv, commandModel, CONNECTION_ERROR, env, ERROR, INVALID_COMMAND_ERROR, logger, metadataErrors, name, operands, options, passwords, programOpts, SUCCESS, WARNING
 
Constructor Summary
StopDomainCommand()
           
 
Method Summary
protected  int dasNotRunning(boolean local)
          Print message and return exit code when we detect that the DAS is not running.
protected  void doCommand()
          Execute the actual stop-domain command.
protected  int executeCommand()
          Execute the command using the options in options and the operands in operands.
protected  void initDomain()
          Override initDomain in LocalDomainCommand to only initialize the local domain information (name, directory) in the local case, when no --host has been specified.
private  int kill()
           
private  boolean timedOut(long startTime)
           
protected  void validate()
          The validate method can be used by a subclass to validate that the type and quantity of parameters and operands matches the requirements for this command.
protected  void waitForDeath()
          Wait for the server to die.
 
Methods inherited from class com.sun.enterprise.admin.cli.LocalDomainCommand
getDomainName, getDomainRootDir, getDomainsDir, isThisDAS, prepare, setDomainName
 
Methods inherited from class com.sun.enterprise.admin.cli.LocalServerCommand
checkForSpecialFiles, getAdminAddress, getAdminAddress, getDomainXml, getMasterPassword, getMasterPasswordFile, getPrevPid, getServerDirs, getUptime, isRestartable, isRunning, isRunning, isRunning, isThisServer, loadAndVerifyKeystore, readFromMasterPasswordFile, resetServerDirs, setLocalPassword, setServerDirs, unsetLocalPassword, verifyMasterPassword, waitForRestart
 
Methods inherited from class com.sun.enterprise.admin.cli.CLICommand
checkHelp, execute, getBooleanOption, getCommand, getManPage, getName, getOperandModel, getOption, getPassword, getProgramOptions, getSystemProperties, getSystemProperty, getUsage, initializeLogger, initializePasswords, inject, ok, parse, postConstruct, prevalidate, printExceptionStackTrace, processProgramOptions, quote, readPassword, toString, usageOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

userArgDomainName

private java.lang.String userArgDomainName

force

java.lang.Boolean force

kill

java.lang.Boolean kill

local

private boolean local

WAIT_FOR_DAS_TIME_MS

private static final long WAIT_FOR_DAS_TIME_MS
See Also:
Constant Field Values
Constructor Detail

StopDomainCommand

public StopDomainCommand()
Method Detail

validate

protected void validate()
                 throws CommandException
Description copied from class: CLICommand
The validate method can be used by a subclass to validate that the type and quantity of parameters and operands matches the requirements for this command.

Overrides:
validate in class LocalDomainCommand
Throws:
CommandException - if execution of the command fails
CommandValidationException - if there's something wrong with the options or arguments

initDomain

protected void initDomain()
                   throws CommandException
Override initDomain in LocalDomainCommand to only initialize the local domain information (name, directory) in the local case, when no --host has been specified.

Overrides:
initDomain in class LocalDomainCommand
Throws:
CommandException

executeCommand

protected int executeCommand()
                      throws CommandException
Description copied from class: CLICommand
Execute the command using the options in options and the operands in operands.

Specified by:
executeCommand in class CLICommand
Returns:
the exit code
Throws:
CommandException - if execution of the command fails
CommandValidationException - if there's something wrong with the options or arguments

dasNotRunning

protected int dasNotRunning(boolean local)
                     throws CommandException
Print message and return exit code when we detect that the DAS is not running.

Throws:
CommandException

doCommand

protected void doCommand()
                  throws CommandException
Execute the actual stop-domain command.

Throws:
CommandException

waitForDeath

protected void waitForDeath()
                     throws CommandException
Wait for the server to die.

Throws:
CommandException

timedOut

private boolean timedOut(long startTime)

kill

private int kill()
          throws CommandException
Throws:
CommandException


Copyright © 2012 GlassFish Community. All Rights Reserved.