Package org.apache.felix.gogo.runtime
Class CommandProcessorImpl
- java.lang.Object
-
- org.apache.felix.gogo.runtime.CommandProcessorImpl
-
- All Implemented Interfaces:
CommandProcessor
public class CommandProcessorImpl extends Object implements CommandProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected ConcurrentMap<String,Map<Object,Integer>>
commands
protected Map<String,Object>
constants
protected Set<Converter>
converters
protected Set<CommandSessionListener>
listeners
protected WeakHashMap<CommandSession,Object>
sessions
protected boolean
stopped
protected ThreadIO
threadIO
-
Fields inherited from interface org.apache.felix.service.command.CommandProcessor
COMMAND_FUNCTION, COMMAND_SCOPE
-
-
Constructor Summary
Constructors Constructor Description CommandProcessorImpl()
CommandProcessorImpl(ThreadIO tio)
-
Method Summary
-
-
-
Field Detail
-
listeners
protected final Set<CommandSessionListener> listeners
-
commands
protected final ConcurrentMap<String,Map<Object,Integer>> commands
-
threadIO
protected final ThreadIO threadIO
-
sessions
protected final WeakHashMap<CommandSession,Object> sessions
-
stopped
protected boolean stopped
-
-
Constructor Detail
-
CommandProcessorImpl
public CommandProcessorImpl()
-
CommandProcessorImpl
public CommandProcessorImpl(ThreadIO tio)
-
-
Method Detail
-
createSession
public CommandSessionImpl createSession(CommandSession parent)
- Specified by:
createSession
in interfaceCommandProcessor
-
createSession
public CommandSessionImpl createSession(InputStream in, OutputStream out, OutputStream err)
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
public void addConverter(Converter c)
-
removeConverter
public void removeConverter(Converter c)
-
addListener
public void addListener(CommandSessionListener l)
-
removeListener
public void removeListener(CommandSessionListener l)
-
removeCommand
public void removeCommand(Object target)
-
convert
public Object convert(CommandSession session, Class<?> desiredType, Object in)
-
eval
public Object eval(CommandSession session, Object[] argv) throws Exception
- Throws:
Exception
-
expr
public Object expr(CommandSessionImpl session, CharSequence expr)
-
invoke
public Object invoke(CommandSessionImpl session, Object target, String name, List<Object> args) throws Exception
- Throws:
Exception
-
redirect
public Path redirect(CommandSessionImpl session, Path path, int mode)
-
-