|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.activemq.console.command.AbstractCommand
public abstract class AbstractCommand
Field Summary | |
---|---|
static java.lang.String |
COMMAND_OPTION_DELIMETER
|
protected CommandContext |
context
|
Constructor Summary | |
---|---|
AbstractCommand()
|
Method Summary | |
---|---|
void |
execute(java.util.List<java.lang.String> tokens)
Execute a generic command, which includes parsing the options for the command and running the specific task. |
protected void |
handleOption(java.lang.String token,
java.util.List<java.lang.String> tokens)
Handle the general options for each command, which includes -h, -?, --help, -D, --version. |
protected void |
parseOptions(java.util.List<java.lang.String> tokens)
Parse any option parameters in the command arguments specified by a '-' as the first character of the token. |
protected abstract void |
printHelp()
Print the help messages for the specific task |
protected abstract void |
runTask(java.util.List<java.lang.String> tokens)
Run the specific task. |
void |
setCommandContext(CommandContext context)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String COMMAND_OPTION_DELIMETER
protected CommandContext context
Constructor Detail |
---|
public AbstractCommand()
Method Detail |
---|
public void setCommandContext(CommandContext context)
setCommandContext
in interface Command
public void execute(java.util.List<java.lang.String> tokens) throws java.lang.Exception
execute
in interface Command
tokens
- - command arguments
java.lang.Exception
protected void parseOptions(java.util.List<java.lang.String> tokens) throws java.lang.Exception
tokens
- - command arguments
java.lang.Exception
protected void handleOption(java.lang.String token, java.util.List<java.lang.String> tokens) throws java.lang.Exception
token
- - option token to handletokens
- - succeeding command arguments
java.lang.Exception
protected abstract void runTask(java.util.List<java.lang.String> tokens) throws java.lang.Exception
tokens
- - command arguments
java.lang.Exception
protected abstract void printHelp()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |