public interface ShellService
All commands in the impl 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.
Modifier and Type | Method and Description |
---|---|
void |
executeCommand(String commandLine,
PrintStream out,
PrintStream err)
This method executes the supplied command line using the
supplied output and error print stream.
|
String |
getCommandDescription(String name)
Returns the description associated with the specified command name.
|
org.osgi.framework.ServiceReference |
getCommandReference(String name)
Returns the service reference associated with the specified
command name.
|
String[] |
getCommands()
Returns an array of command names available in the impl service.
|
String |
getCommandUsage(String name)
Returns the usage string associated with the specified command name.
|
String[] getCommands()
String getCommandUsage(String name)
name
- the name of the target command.String getCommandDescription(String name)
name
- the name of the target command.org.osgi.framework.ServiceReference getCommandReference(String name)
name
- the name of the target command.void executeCommand(String commandLine, PrintStream out, PrintStream err) throws 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.Exception
Copyright © 2006-2015 The Apache Software Foundation. All Rights Reserved.