|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A tag interface for any class that wants to be a provider for CLI commands.
Classes that implement this interface may be registered with the CliService to provide CLI behavior.
The CliService will reflect on registered classes for any method that matches one of the described signatures. If a user specifies a command (as a string), the method matching the command name (with the appropriate signature) is searched for and executed (if found). The CliService that invokes the ICliBundle methods will always be in the same JVM.
Commands may be written to handle character streams for stdout. The expected method signature for a character stream command is:
public int commandName(Locale locale, String[] args, Writer out) throws Exception;
where:
Exit codes (int values) are passed to the client shell upon termination.
Common exit codes are:
Additional positive non-overlapping codes can be defined in specific bundle implementations for more specific conditions.
Field Summary | |
---|---|
static int |
COMMAND_EXCEPTION
Command implementation exception occured |
static int |
FAIL
General request of action failed |
static int |
NOT_FOUND
Command or bundle not found |
static int |
OK
Successfull command execution code |
static int |
SECURITY_FAILURE
Unauthorized client security failure |
static int |
USAGE
Usage error code |
Method Summary | |
---|---|
int |
help(java.util.Locale locale,
java.lang.String[] args,
java.io.Writer out)
Bundle help command which must be implemented by all bundles |
Field Detail |
public static final int OK
public static final int USAGE
public static final int NOT_FOUND
public static final int SECURITY_FAILURE
public static final int COMMAND_EXCEPTION
public static final int FAIL
Method Detail |
public int help(java.util.Locale locale, java.lang.String[] args, java.io.Writer out) throws java.lang.Exception
java.lang.Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |