public class CommandProcessorImpl extends Object implements CommandProcessor
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
commands |
protected Map<String,Object> |
constants |
protected Set<Converter> |
converters |
protected Set<CommandSessionListener> |
listeners |
protected WeakHashMap<CommandSession,Object> |
sessions |
protected ThreadIO |
threadIO |
COMMAND_FUNCTION, COMMAND_SCOPE
Constructor and Description |
---|
CommandProcessorImpl(ThreadIO tio) |
Modifier and Type | Method and Description |
---|---|
void |
addCommand(String scope,
Object target) |
void |
addCommand(String scope,
Object target,
Class<?> functions) |
void |
addCommand(String scope,
Object target,
String function) |
Object |
addConstant(String name,
Object target) |
void |
addConverter(Converter c) |
void |
addListener(CommandSessionListener l) |
Object |
convert(Class<?> desiredType,
Object in) |
CommandSession |
createSession(InputStream in,
PrintStream out,
PrintStream err)
Create a new command session associated with IO streams.
|
Object |
eval(CommandSession session,
Object[] argv) |
Set<String> |
getCommands() |
protected void |
put(String name,
Object target) |
void |
removeCommand(Object target) |
void |
removeCommand(String scope,
String function) |
Object |
removeConstant(String name) |
void |
removeConverter(Converter c) |
void |
removeListener(CommandSessionListener l) |
void |
stop() |
protected final Set<CommandSessionListener> listeners
protected final ThreadIO threadIO
protected final WeakHashMap<CommandSession,Object> sessions
public CommandProcessorImpl(ThreadIO tio)
public CommandSession createSession(InputStream in, PrintStream out, PrintStream err)
CommandProcessor
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 eval(CommandSession session, Object[] argv) throws Exception
Exception
Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.