org.crsh.shell.impl.command
Class CRaSHSession
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<String,Object>
org.crsh.shell.impl.command.CRaSHSession
- All Implemented Interfaces:
- Closeable, Serializable, Cloneable, Map<String,Object>, RuntimeContext, ShellSession, Shell
-
class CRaSHSession
- extends HashMap<String,Object>
-
- implements Shell, Closeable, RuntimeContext, ShellSession
-
Nested classes/interfaces inherited from class java.util.AbstractMap |
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Nested classes/interfaces inherited from interface java.util.Map |
Map.Entry<K,V> |
Methods inherited from class java.util.HashMap |
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
log
static final Logger log
-
.
accessLog
static final Logger accessLog
-
.
crash
public final CRaSH crash
-
.
user
final Principal user
-
.
repl
private Repl repl
-
.
CRaSHSession
CRaSHSession(CRaSH crash,
Principal user)
getRepl
public Repl getRepl()
-
- Specified by:
getRepl
in interface ShellSession
-
- Returns:
- the current repl of this session
setRepl
public void setRepl(Repl repl)
throws NullPointerException
- Description copied from interface:
ShellSession
-
Set the current repl of this session.
-
- Specified by:
setRepl
in interface ShellSession
-
- Parameters:
repl
- the new repl
- Throws:
NullPointerException
- if the repl is null
getCommands
public Iterable<Map.Entry<String,String>> getCommands()
-
- Specified by:
getCommands
in interface ShellSession
-
getCommand
public Command<?> getCommand(String name)
throws CommandException
-
- Specified by:
getCommand
in interface ShellSession
-
- Throws:
CommandException
getContext
public PluginContext getContext()
-
- Specified by:
getContext
in interface ShellSession
-
getSession
public Map<String,Object> getSession()
- Description copied from interface:
RuntimeContext
-
Returns the current session.
-
- Specified by:
getSession
in interface RuntimeContext
-
- Returns:
- the session map
getAttributes
public Map<String,Object> getAttributes()
- Description copied from interface:
RuntimeContext
-
Returns the current attributes.
-
- Specified by:
getAttributes
in interface RuntimeContext
-
- Returns:
- the attributes map
close
public void close()
-
- Specified by:
close
in interface Closeable
-
getWelcome
public String getWelcome()
- Description copied from interface:
Shell
-
Returns the welcome message.
-
- Specified by:
getWelcome
in interface Shell
-
- Returns:
- the welcome message
getPrompt
public String getPrompt()
- Description copied from interface:
Shell
-
Returns the shell prompt.
-
- Specified by:
getPrompt
in interface Shell
-
- Returns:
- the shell prompt
createProcess
public ShellProcess createProcess(String request)
- Description copied from interface:
Shell
-
Process a request.
-
- Specified by:
createProcess
in interface Shell
-
- Parameters:
request
- the request to process
- Returns:
- the process
complete
public CompletionMatch complete(String prefix)
-
For now basic implementation
-
- Specified by:
complete
in interface Shell
-
- Parameters:
prefix
- the prefix to complete
- Returns:
- the sorted list of available suffixes
setCRaSHLoader
ClassLoader setCRaSHLoader()
-
-
setPreviousLoader
void setPreviousLoader(ClassLoader previous)
-
-
Copyright © 2015 eXo Platform SAS. All Rights Reserved.