org.crsh.shell.impl
Class CRaSH

java.lang.Object
  extended by org.crsh.shell.impl.CRaSH
All Implemented Interfaces:
Shell

public class CRaSH
extends Object
implements Shell

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
CRaSH(PluginContext context)
           
 
Method Summary
 void close()
           
 Map<String,String> complete(String prefix)
          For now basic implementation
 Object getAttribute(String name)
           
 ShellCommand getCommand(String name)
          Attempt to obtain a command instance.
 groovy.lang.GroovyShell getGroovyShell()
           
 String getPrompt()
          Returns the shell prompt.
 String getWelcome()
          Returns the welcome message.
 void process(String request, ShellProcessContext processContext)
          Process a request.
 void setAttribute(String name, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRaSH

public CRaSH(PluginContext context)
Method Detail

getCommand

public ShellCommand getCommand(String name)
                        throws CreateCommandException,
                               NullPointerException
Attempt to obtain a command instance. Null is returned when such command does not exist.

Parameters:
name - the command name
Returns:
a command instance
Throws:
CreateCommandException - if an error occured preventing the command creation
NullPointerException - if the name argument is null

getGroovyShell

public groovy.lang.GroovyShell getGroovyShell()

getAttribute

public Object getAttribute(String name)

setAttribute

public void setAttribute(String name,
                         Object value)

close

public void close()

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

process

public void process(String request,
                    ShellProcessContext processContext)
Description copied from interface: Shell
Process a request.

Specified by:
process in interface Shell
Parameters:
request - the request to process
processContext - the process context

complete

public Map<String,String> 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


Copyright © 2011 eXo Platform SAS. All Rights Reserved.