org.crsh.shell.impl.command
Class CRaSHSession

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<String,Object>
          extended by 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 Class Summary
 
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>
 
Field Summary
(package private) static Logger accessLog
          .
 CRaSH crash
          .
(package private) static Logger log
          .
private  Repl repl
          .
(package private)  Principal user
          .
 
Constructor Summary
CRaSHSession(CRaSH crash, Principal user)
           
 
Method Summary
 void close()
           
 CompletionMatch complete(String prefix)
          For now basic implementation
 ShellProcess createProcess(String request)
          Process a request.
 Map<String,Object> getAttributes()
          Returns the current attributes.
 Command<?> getCommand(String name)
           
 Iterable<Map.Entry<String,String>> getCommands()
           
 PluginContext getContext()
           
 String getPrompt()
          Returns the shell prompt.
 Repl getRepl()
           
 Map<String,Object> getSession()
          Returns the current session.
 String getWelcome()
          Returns the welcome message.
(package private)  ClassLoader setCRaSHLoader()
           
(package private)  void setPreviousLoader(ClassLoader previous)
           
 void setRepl(Repl repl)
          Set the current repl of this session.
 
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
 

Field Detail

log

static final Logger log
.


accessLog

static final Logger accessLog
.


crash

public final CRaSH crash
.


user

final Principal user
.


repl

private Repl repl
.

Constructor Detail

CRaSHSession

CRaSHSession(CRaSH crash,
             Principal user)
Method Detail

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.