Knopflerfish OSGi 5.2.0

org.osgi.service.command
Interface CommandProcessor


public interface CommandProcessor

A Command Processor is a service that is registered by a script engine that can execute commands. A Command Processor is a factory for Command Session objects. The Command Session maintains execution state and holds the console and keyboard streams. A Command Processor must track any services that are registered with the COMMAND_SCOPE and COMMAND_FUNCTION properties. The functions listed in the COMMAND_FUNCTION property must be made available as functions in the script language. TODO The javadoc in this class need a good scrub before release.

Version:
$Revision: 5654 $
ThreadSafe

Field Summary
static java.lang.String COMMAND_FUNCTION
          A String, array, or list of method names that may be called for this command provider.
static java.lang.String COMMAND_SCOPE
          The scope of commands provided by this service.
 
Method Summary
 CommandSession createSession(java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
          Create a new command session associated with IO streams.
 

Field Detail

COMMAND_SCOPE

static final java.lang.String COMMAND_SCOPE
The scope of commands provided by this service. This name can be used to distinguish between different command providers with the same function names.

See Also:
Constant Field Values

COMMAND_FUNCTION

static final java.lang.String COMMAND_FUNCTION
A String, array, or list of method names that may be called for this command provider. A name may end with a *, this will then be calculated from all declared public methods in this service. Help information for the command may be supplied with a space as separation.

See Also:
Constant Field Values
Method Detail

createSession

CommandSession createSession(java.io.InputStream in,
                             java.io.PrintStream out,
                             java.io.PrintStream err)
Create a new command session associated with IO streams. The session is bound to the life cycle of the bundle getting this service. The session will be automatically closed when this bundle is stopped or the service is returned. The shell will provide any available commands to this session and can set additional variables.

Parameters:
in - The value used for System.in
out - The stream used for System.out
err - The stream used for System.err
Returns:
A new session.

Knopflerfish OSGi 5.2.0