public interface Command
To register a custom command, use the CommandRegistry, registering the
Commands when the bundle starts and and unregistering them when the
bundle stops.
You can also register a custom command by registering it as an OSGi service
with the NAME set to the value of getName(). You are
responsible for enabling and disabling it at appropriate times then.
CommandRegistry| Modifier and Type | Method and Description |
|---|---|
String |
getDescription()
A short description for the command indicating what it does.
|
String |
getName()
Returns a name for this command.
|
org.apache.commons.cli.Options |
getOptions()
Returns the Options that the command is prepared to handle.
|
String |
getUsage()
How the user should invoke this command
|
boolean |
isAvailableInShell()
Whether the command is available to be invoked from within the shell.
|
boolean |
isAvailableOutsideShell()
Indicates if the command is available to be invoked from outside the
shell (from the main command line).
|
boolean |
isStorageRequired() |
void |
run(CommandContext ctx)
Execute the command
|
static final String NAME
void run(CommandContext ctx) throws CommandException
CommandExceptionString getName()
String getDescription()
String getUsage()
org.apache.commons.cli.Options getOptions()
boolean isStorageRequired()
boolean isAvailableInShell()
boolean isAvailableOutsideShell()
Copyright © 2012. All Rights Reserved.