@Capability(namespace="osgi.service", attribute="objectClass=\'org.apache.felix.service.command.CommandProcessor\'") public class CommandProcessorImpl extends Object implements CommandProcessor
Modifier and Type | Field and 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 |
COMMAND_FUNCTION, COMMAND_SCOPE
Constructor and Description |
---|
CommandProcessorImpl() |
CommandProcessorImpl(ThreadIO tio) |
protected final Set<CommandSessionListener> listeners
protected final ConcurrentMap<String,Map<Object,Integer>> commands
protected final ThreadIO threadIO
protected final WeakHashMap<CommandSession,Object> sessions
protected boolean stopped
public CommandProcessorImpl()
public CommandProcessorImpl(ThreadIO tio)
public CommandSessionImpl createSession(CommandSession parent)
createSession
in interface CommandProcessor
public CommandSessionImpl createSession(InputStream in, OutputStream out, OutputStream err)
CommandProcessor
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.
createSession
in interface CommandProcessor
in
- The value used for System.inout
- The stream used for System.outerr
- The stream used for System.errpublic void stop()
public void addConverter(Converter c)
public void removeConverter(Converter c)
public void addListener(CommandSessionListener l)
public void removeListener(CommandSessionListener l)
public void removeCommand(Object target)
public Object convert(CommandSession session, Class<?> desiredType, Object in)
public Object eval(CommandSession session, Object[] argv) throws Exception
Exception
public Object expr(CommandSessionImpl session, CharSequence expr)
public Object invoke(CommandSessionImpl session, Object target, String name, List<Object> args) throws Exception
Exception
public Path redirect(CommandSessionImpl session, Path path, int mode)
Copyright © 2006–2019 The Apache Software Foundation. All rights reserved.