Class ShutdownCommand
- java.lang.Object
-
- org.apache.activemq.console.command.AbstractCommand
-
- org.apache.activemq.console.command.AbstractJmxCommand
-
- org.apache.activemq.console.command.ShutdownCommand
-
- All Implemented Interfaces:
Command
- Direct Known Subclasses:
StopGracefullyCommand
public class ShutdownCommand extends AbstractJmxCommand
-
-
Field Summary
Fields Modifier and Type Field Description 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
Constructors Constructor Description ShutdownCommand()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 commandprotected void
runTask(List brokerNames)
Shuts down the specified broker or brokersprotected 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
handleException, parseOptions, printHelpFromFile, setCommandContext
-
-
-
-
Field Detail
-
helpFile
protected String[] helpFile
-
-
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 classAbstractCommand
- 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 serverbrokerBeans
- - 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 classAbstractJmxCommand
- Parameters:
token
- - option token to handletokens
- - succeeding command arguments- Throws:
Exception
-
printHelp
protected void printHelp()
Print the help messages for the browse command- Specified by:
printHelp
in classAbstractCommand
-
-