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, Shell
-
public class CRaSHSession
- extends HashMap<String,Object>
-
- implements Shell, Closeable, RuntimeContext
-
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class java.util.AbstractMap |
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V> |
Field Summary |
(package private) static Logger |
accessLog
. |
(package private) CRaSH |
crash
. |
private groovy.lang.GroovyShell |
groovyShell
. |
(package private) static Logger |
log
. |
(package private) Principal |
user
. |
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 |
equals, hashCode |
log
static final Logger log
-
.
accessLog
static final Logger accessLog
-
.
groovyShell
private groovy.lang.GroovyShell groovyShell
-
.
crash
final CRaSH crash
-
.
user
final Principal user
-
.
CRaSHSession
CRaSHSession(CRaSH crash,
Principal user)
getGroovyShell
public groovy.lang.GroovyShell getGroovyShell()
-
Used for testing purposes.
-
-
- Returns:
- a groovy shell operating on the session attributes
getLifeCycle
public GroovyScript getLifeCycle(String name)
throws NoSuchCommandException,
NullPointerException
-
-
- Throws:
NoSuchCommandException
NullPointerException
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
-
eval
private String eval(String name,
String def)
-
-
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 © 2014 eXo Platform SAS. All Rights Reserved.