org.apache.activemq.console.command
Class ShutdownCommand

java.lang.Object
  extended by org.apache.activemq.console.command.AbstractCommand
      extended by org.apache.activemq.console.command.AbstractJmxCommand
          extended by org.apache.activemq.console.command.ShutdownCommand
All Implemented Interfaces:
Command
Direct Known Subclasses:
StopGracefullyCommand

public class ShutdownCommand
extends AbstractJmxCommand


Field Summary
protected  String[] helpFile
           
 
Fields inherited from class org.apache.activemq.console.command.AbstractJmxCommand
DEFAULT_JMX_URL
 
Fields inherited from class org.apache.activemq.console.command.AbstractCommand
COMMAND_OPTION_DELIMETER, context
 
Constructor Summary
ShutdownCommand()
           
 
Method Summary
 String getName()
           
 String getOneLineDescription()
           
protected  void handleOption(String token, List<String> tokens)
          Handle the --all option.
protected  void printHelp()
          Print the help messages for the browse command
protected  void runTask(List brokerNames)
          Shuts down the specified broker or brokers
protected  void stopBrokers(MBeanServerConnection jmxConnection, Collection brokerBeans)
          Stops the list of brokers.
 
Methods inherited from class org.apache.activemq.console.command.AbstractJmxCommand
closeJmxConnection, createJmxConnection, execute, findJMXUrlByProcessId, getJmxPassword, getJmxServiceUrl, getJmxUser, getJVM, isJmxUseLocal, isSunJVM, setJmxPassword, setJmxServiceUrl, setJmxServiceUrl, setJmxUseLocal, setJmxUser, useJmxServiceUrl
 
Methods inherited from class org.apache.activemq.console.command.AbstractCommand
parseOptions, setCommandContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

helpFile

protected String[] helpFile
Constructor Detail

ShutdownCommand

public ShutdownCommand()
Method Detail

getName

public String getName()

getOneLineDescription

public String getOneLineDescription()

runTask

protected void runTask(List brokerNames)
                throws Exception
Shuts down the specified broker or brokers

Specified by:
runTask in class AbstractCommand
Parameters:
brokerNames - - names of brokers to shutdown
Throws:
Exception

stopBrokers

protected void stopBrokers(MBeanServerConnection jmxConnection,
                           Collection brokerBeans)
                    throws Exception
Stops the list of brokers.

Parameters:
jmxConnection - - connection to the mbean server
brokerBeans - - broker mbeans to stop @throws Exception
Throws:
Exception

handleOption

protected void handleOption(String token,
                            List<String> tokens)
                     throws Exception
Handle the --all option.

Overrides:
handleOption in class AbstractJmxCommand
Parameters:
token - - option token to handle
tokens - - succeeding command arguments
Throws:
Exception

printHelp

protected void printHelp()
Print the help messages for the browse command

Specified by:
printHelp in class AbstractCommand


Copyright © 2005–2013 The Apache Software Foundation. All rights reserved.