org.crsh.shell.impl
Class CRaSHSession

java.lang.Object
  extended by org.crsh.shell.impl.CRaSHSession
All Implemented Interfaces:
Closeable, Shell

public class CRaSHSession
extends Object
implements Shell, Closeable

Version:
$Revision$
Author:
Julien Viet

Field Summary
(package private) static org.slf4j.Logger accessLog
          .
(package private)  Map<String,Object> attributes
          .
(package private)  CRaSH crash
          .
private  groovy.lang.GroovyShell groovyShell
          .
(package private) static org.slf4j.Logger log
          .
(package private)  Principal user
          .
 
Constructor Summary
CRaSHSession(CRaSH crash, Principal user)
           
 
Method Summary
 void close()
           
 CommandCompletion complete(String prefix)
          For now basic implementation
 ShellProcess createProcess(String request)
          Process a request.
 Object getAttribute(String name)
           
 groovy.lang.GroovyShell getGroovyShell()
          Used for testing purposes.
 groovy.lang.Script getLifeCycle(String name)
           
 String getPrompt()
          Returns the shell prompt.
 String getWelcome()
          Returns the welcome message.
 void setAttribute(String name, Object value)
           
(package private)  ClassLoader setCRaSHLoader()
           
(package private)  void setPreviousLoader(ClassLoader previous)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

static final org.slf4j.Logger log
.


accessLog

static final org.slf4j.Logger accessLog
.


groovyShell

private groovy.lang.GroovyShell groovyShell
.


crash

final CRaSH crash
.


attributes

final Map<String,Object> attributes
.


user

final Principal user
.

Constructor Detail

CRaSHSession

CRaSHSession(CRaSH crash,
             Principal user)
Method Detail

getGroovyShell

public groovy.lang.GroovyShell getGroovyShell()
Used for testing purposes.

Returns:
a groovy shell operating on the session attributes

getLifeCycle

public groovy.lang.Script getLifeCycle(String name)
                                throws NoSuchCommandException,
                                       NullPointerException
Throws:
NoSuchCommandException
NullPointerException

getAttribute

public Object getAttribute(String name)

setAttribute

public void setAttribute(String name,
                         Object value)

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 CommandCompletion 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 © 2012 eXo Platform SAS. All Rights Reserved.