|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.felix.gogo.runtime.CommandSessionImpl
public class CommandSessionImpl
Field Summary | |
---|---|
static String |
COMMANDS
|
protected InputStream |
in
|
protected PrintStream |
out
|
static String |
SESSION_CLOSED
|
protected Map<String,Object> |
variables
|
static String |
VARIABLES
|
Fields inherited from interface org.apache.felix.service.command.Converter |
---|
CONVERTER_CLASSES, INSPECT, LINE, PART |
Constructor Summary | |
---|---|
protected |
CommandSessionImpl(CommandProcessorImpl shell,
InputStream in,
PrintStream out,
PrintStream err)
|
Method Summary | |
---|---|
void |
close()
Close this command session. |
Object |
convert(Class<?> desiredType,
Object in)
Convert an object to another type. |
Object |
execute(CharSequence commandline)
Execute a program in this session. |
CharSequence |
format(Object result,
int inspect)
Convert an object to string form (CharSequence). |
CharSequence |
format(Object target,
int level,
Converter escape)
Convert an objet to a CharSequence object in the requested format. |
Object |
get(String name)
Get the value of a variable. |
PrintStream |
getConsole()
Return the PrintStream for the console. |
InputStream |
getKeyboard()
Return the input stream that is the first of the pipeline. |
void |
put(String name,
Object value)
Set the value of a variable. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String SESSION_CLOSED
public static final String VARIABLES
public static final String COMMANDS
protected InputStream in
protected PrintStream out
protected final Map<String,Object> variables
Constructor Detail |
---|
protected CommandSessionImpl(CommandProcessorImpl shell, InputStream in, PrintStream out, PrintStream err)
Method Detail |
---|
public void close()
CommandSession
close
in interface CommandSession
public Object execute(CharSequence commandline) throws Exception
CommandSession
execute
in interface CommandSession
Exception
public InputStream getKeyboard()
CommandSession
getKeyboard
in interface CommandSession
public Object get(String name)
CommandSession
get
in interface CommandSession
public void put(String name, Object value)
CommandSession
put
in interface CommandSession
name
- Name of the variable.value
- Value of the variablepublic PrintStream getConsole()
CommandSession
getConsole
in interface CommandSession
public CharSequence format(Object target, int level, Converter escape) throws Exception
Converter
format
in interface Converter
target
- The object to be converted to a Stringlevel
- One of INSPECT, LINE, or PART.escape
- Use this object to format sub ordinate objects.
Exception
public Object convert(Class<?> desiredType, Object in)
CommandSession
convert
in interface CommandSession
convert
in interface Converter
desiredType
- The type that the returned object can be assigned toin
- The object that must be converted
public CharSequence format(Object result, int inspect)
CommandSession
format
in interface CommandSession
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |