public class CommandSessionImpl extends java.lang.Object implements CommandSession, Converter
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
COMMANDS |
protected java.io.InputStream |
in |
protected java.io.PrintStream |
out |
static java.lang.String |
SESSION_CLOSED |
protected java.util.Map<java.lang.String,java.lang.Object> |
variables |
static java.lang.String |
VARIABLES |
CONVERTER_CLASSES, INSPECT, LINE, PART| Modifier | Constructor and Description |
|---|---|
protected |
CommandSessionImpl(CommandProcessorImpl shell,
java.io.InputStream in,
java.io.PrintStream out,
java.io.PrintStream err) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close this command session.
|
java.lang.Object |
convert(java.lang.Class<?> desiredType,
java.lang.Object in)
Convert an object to another type.
|
java.lang.Object |
execute(java.lang.CharSequence commandline)
Execute a program in this session.
|
java.lang.CharSequence |
format(java.lang.Object result,
int inspect)
Convert an object to string form (CharSequence).
|
java.lang.CharSequence |
format(java.lang.Object target,
int level,
Converter escape)
Convert an objet to a CharSequence object in the requested format.
|
java.lang.Object |
get(java.lang.String name)
Get the value of a variable.
|
java.io.PrintStream |
getConsole()
Return the PrintStream for the console.
|
java.io.InputStream |
getKeyboard()
Return the input stream that is the first of the pipeline.
|
void |
put(java.lang.String name,
java.lang.Object value)
Set the value of a variable.
|
public static final java.lang.String SESSION_CLOSED
public static final java.lang.String VARIABLES
public static final java.lang.String COMMANDS
protected java.io.InputStream in
protected java.io.PrintStream out
protected final java.util.Map<java.lang.String,java.lang.Object> variables
protected CommandSessionImpl(CommandProcessorImpl shell, java.io.InputStream in, java.io.PrintStream out, java.io.PrintStream err)
public void close()
CommandSessionclose in interface CommandSessionpublic java.lang.Object execute(java.lang.CharSequence commandline)
throws java.lang.Exception
CommandSessionexecute in interface CommandSessionjava.lang.Exceptionpublic java.io.InputStream getKeyboard()
CommandSessiongetKeyboard in interface CommandSessionpublic java.lang.Object get(java.lang.String name)
CommandSessionget in interface CommandSessionpublic void put(java.lang.String name,
java.lang.Object value)
CommandSessionput in interface CommandSessionname - Name of the variable.value - Value of the variablepublic java.io.PrintStream getConsole()
CommandSessiongetConsole in interface CommandSessionpublic java.lang.CharSequence format(java.lang.Object target,
int level,
Converter escape)
throws java.lang.Exception
Converterpublic java.lang.Object convert(java.lang.Class<?> desiredType,
java.lang.Object in)
CommandSessionconvert in interface CommandSessionconvert in interface ConverterdesiredType - The type that the returned object can be assigned toin - The object that must be convertedpublic java.lang.CharSequence format(java.lang.Object result,
int inspect)
CommandSessionformat in interface CommandSessionCopyright © 2014 FuseSource, Corp.. All Rights Reserved.