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 booleanprotected final ThreadIOFields inherited from interface org.apache.felix.service.command.CommandProcessor
COMMAND_FUNCTION, COMMAND_SCOPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommand(String scope, Object target) voidaddCommand(String scope, Object target, Class<?> functions) voidaddCommand(String scope, Object target, Class<?> functions, int ranking) voidaddCommand(String scope, Object target, String function) voidaddCommand(String scope, Object target, String function, int ranking) addConstant(String name, Object target) voidvoidconvert(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 FunctiongetCommand(String name, Object path) redirect(CommandSessionImpl session, Path path, int mode) voidremoveCommand(Object target) voidremoveCommand(String scope, String function) voidremoveCommand(String scope, String function, Object target) removeConstant(String name) voidvoidvoidstop()
-
Field Details
-
converters
-
listeners
-
commands
-
constants
-
threadIO
-
sessions
-
stopped
protected boolean stopped
-
-
Constructor Details
-
CommandProcessorImpl
public CommandProcessorImpl() -
CommandProcessorImpl
-
-
Method Details
-
createSession
- Specified by:
createSessionin interfaceCommandProcessor
-
createSession
Description copied from interface:CommandProcessorCreate 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:
createSessionin 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
-