|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface defines the Oscar shell service. The shell service is an extensible, user interface neutral shell for controlling and interacting with Oscar. In general, the shell service assumes that it is operating in a command line fashion, i.e., it receives a complete command line, parses it, and executes the corresponding command, but graphical interfaces are also possible.
All commands in the shell service are actually implemented as OSGi services; these services implement the Command service interface. Any bundle can implement custom commands by creating command services and registering them with the OSGi framework.
Method Summary | |
void |
executeCommand(java.lang.String commandLine,
java.io.PrintStream out,
java.io.PrintStream err)
This method executes the supplied command line using the supplied output and error print stream. |
java.lang.String |
getCommandDescription(java.lang.String name)
Returns the description associated with the specified command name. |
ServiceReference |
getCommandReference(java.lang.String name)
Returns the service reference associated with the specified command name. |
java.lang.String[] |
getCommands()
Returns an array of command names available in the shell service. |
java.lang.String |
getCommandUsage(java.lang.String name)
Returns the usage string associated with the specified command name. |
Method Detail |
public java.lang.String[] getCommands()
public java.lang.String getCommandUsage(java.lang.String name)
name
- the name of the target command.
public java.lang.String getCommandDescription(java.lang.String name)
name
- the name of the target command.
public ServiceReference getCommandReference(java.lang.String name)
name
- the name of the target command.
public void executeCommand(java.lang.String commandLine, java.io.PrintStream out, java.io.PrintStream err) throws java.lang.Exception
update 3 http://www.foo.com/bar.jar
This is interpretted as an update command; as a result, the entire command line (include command name) is passed into the execute() method of the command service with the name update if one exists. If the corresponding command service is not found, then an error message is printed to the error print stream.
commandLine
- the command line to execute.out
- the standard output print stream.err
- the standard error print stream.
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |