Package org.apache.felix.gogo.runtime
Class CommandProcessorImpl
java.lang.Object
org.apache.felix.gogo.runtime.CommandProcessorImpl
- All Implemented Interfaces:
CommandProcessor
@Capability(namespace="osgi.service",
attribute="objectClass=\'org.apache.felix.service.command.CommandProcessor\'")
public class CommandProcessorImpl
extends Object
implements CommandProcessor
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final ConcurrentMap
<String, Map<Object, Integer>> protected final Set
<CommandSessionListener> protected final WeakHashMap
<CommandSession, Object> protected boolean
protected final ThreadIO
Fields inherited from interface org.apache.felix.service.command.CommandProcessor
COMMAND_FUNCTION, COMMAND_SCOPE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommand
(String scope, Object target) void
addCommand
(String scope, Object target, Class<?> functions) void
addCommand
(String scope, Object target, Class<?> functions, int ranking) void
addCommand
(String scope, Object target, String function) void
addCommand
(String scope, Object target, String function, int ranking) addConstant
(String name, Object target) void
void
convert
(CommandSession session, Class<?> desiredType, Object in) createSession
(InputStream in, OutputStream out, OutputStream err) Create a new command session associated with IO streams.createSession
(CommandSession parent) eval
(CommandSession session, Object[] argv) expr
(CommandSessionImpl session, CharSequence expr) protected Function
getCommand
(String name, Object path) redirect
(CommandSessionImpl session, Path path, int mode) void
removeCommand
(Object target) void
removeCommand
(String scope, String function) void
removeCommand
(String scope, String function, Object target) removeConstant
(String name) void
void
void
stop()
-
Field Details
-
converters
-
listeners
-
commands
-
constants
-
threadIO
-
sessions
-
stopped
protected boolean stopped
-
-
Constructor Details
-
CommandProcessorImpl
public CommandProcessorImpl() -
CommandProcessorImpl
-
-
Method Details
-
createSession
- Specified by:
createSession
in interfaceCommandProcessor
-
createSession
Description copied from interface:CommandProcessor
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.
- Specified by:
createSession
in interfaceCommandProcessor
- Parameters:
in
- The value used for System.inout
- The stream used for System.outerr
- The stream used for System.err- Returns:
- A new session.
-
stop
public void stop() -
addConverter
-
removeConverter
-
addListener
-
removeListener
-
getCommands
-
getCommand
-
addCommand
-
addCommand
-
addCommand
-
addConstant
-
removeConstant
-
addCommand
-
addCommand
-
removeCommand
-
removeCommand
-
removeCommand
-
convert
-
eval
- Throws:
Exception
-
expr
-
invoke
public Object invoke(CommandSessionImpl session, Object target, String name, List<Object> args) throws Exception - Throws:
Exception
-
redirect
-