Package org.apache.felix.shell.impl
Class Activator.ShellServiceImpl
java.lang.Object
org.apache.felix.shell.impl.Activator.ShellServiceImpl
- All Implemented Interfaces:
ShellService,ShellService
- Enclosing class:
Activator
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCommand(org.osgi.framework.ServiceReference ref) protected voidvoidexecuteCommand(String commandLine, PrintStream out, PrintStream err) This method executes the supplied command line using the supplied output and error print stream.protected CommandgetCommand(String name) getCommandDescription(String name) Returns the description associated with the specified command name.org.osgi.framework.ServiceReferencegetCommandReference(String name) Returns the service reference associated with the specified command name.String[]Returns an array of command names available in the impl service.getCommandUsage(String name) Returns the usage string associated with the specified command name.voidremoveCommand(org.osgi.framework.ServiceReference ref)
-
Field Details
-
m_commandRefMap
-
m_commandNameMap
-
-
Constructor Details
-
ShellServiceImpl
private ShellServiceImpl()
-
-
Method Details
-
getCommands
Description copied from interface:ShellServiceReturns an array of command names available in the impl service.- Specified by:
getCommandsin interfaceShellService- Specified by:
getCommandsin interfaceShellService- Returns:
- an array of available command names or an empty array.
-
getCommandUsage
Description copied from interface:ShellServiceReturns the usage string associated with the specified command name.- Specified by:
getCommandUsagein interfaceShellService- Specified by:
getCommandUsagein interfaceShellService- Parameters:
name- the name of the target command.- Returns:
- the usage string of the specified command or null.
-
getCommandDescription
Description copied from interface:ShellServiceReturns the description associated with the specified command name.- Specified by:
getCommandDescriptionin interfaceShellService- Specified by:
getCommandDescriptionin interfaceShellService- Parameters:
name- the name of the target command.- Returns:
- the description of the specified command or null.
-
getCommandReference
Description copied from interface:ShellServiceReturns the service reference associated with the specified command name.- Specified by:
getCommandReferencein interfaceShellService- Specified by:
getCommandReferencein interfaceShellService- Parameters:
name- the name of the target command.- Returns:
- the description of the specified command or null.
-
removeCommand
public void removeCommand(org.osgi.framework.ServiceReference ref) -
executeCommand
Description copied from interface:ShellServiceThis method executes the supplied command line using the supplied output and error print stream. The assumption of this method is that a command line will be typed by the user (or perhaps constructed by a GUI) and passed into it for execution. The command line is interpretted in a very simplistic fashion; it takes the leading string of characters terminated by a space character (not including it) and assumes that this leading token is the command name. For an example, consider the following command line:update 3 http://www.foo.com/bar.jarThis 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.
- Specified by:
executeCommandin interfaceShellService- Specified by:
executeCommandin interfaceShellService- Parameters:
commandLine- the command line to execute.out- the standard output print stream.err- the standard error print stream.- Throws:
Exception
-
getCommand
-
addCommand
protected void addCommand(org.osgi.framework.ServiceReference ref) -
clearCommands
protected void clearCommands()
-