org.crsh.lang.java
Class JavaCommandManager

java.lang.Object
  extended by org.crsh.plugin.CRaSHPlugin<CommandManager>
      extended by org.crsh.lang.java.JavaCommandManager
All Implemented Interfaces:
CommandManager

public class JavaCommandManager
extends CRaSHPlugin<CommandManager>
implements CommandManager

Author:
Julien Viet

Field Summary
private  Compiler compiler
          .
private static Set<String> EXT
          .
 
Fields inherited from class org.crsh.plugin.CRaSHPlugin
CONSTRUCTED, FAILED, INITIALIZED, INITIALIZING, log
 
Constructor Summary
JavaCommandManager()
           
 
Method Summary
 void destroy(HashMap<String,Object> session)
           
 String doCallBack(HashMap<String,Object> session, String name, String defaultValue)
           
 Set<String> getExtensions()
          Returns the set of extensions managed by this implementation.
 CommandManager getImplementation()
          Returns the implementation.
 void init()
          Implement this method to know about init life cycle callback.
 void init(HashMap<String,Object> session)
           
 boolean isActive()
          Return true if this command manager is active.
 CommandResolution resolveCommand(String name, byte[] source)
          Resolve a command for the specified command name.
 
Methods inherited from class org.crsh.plugin.CRaSHPlugin
createConfigurationCapabilities, destroy, getConfigurationCapabilities, getContext, getStatus, getType, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

EXT

private static final Set<String> EXT
.


compiler

private Compiler compiler
.

Constructor Detail

JavaCommandManager

public JavaCommandManager()
Method Detail

isActive

public boolean isActive()
Description copied from interface: CommandManager
Return true if this command manager is active. Implementation can decide based on the runtime, for instance the Groovy REPL can be inactive when Groovy is not available at runtime.

Specified by:
isActive in interface CommandManager
Returns:
the active status

init

public void init()
Description copied from class: CRaSHPlugin
Implement this method to know about init life cycle callback.

Overrides:
init in class CRaSHPlugin<CommandManager>

getImplementation

public CommandManager getImplementation()
Description copied from class: CRaSHPlugin
Returns the implementation.

Specified by:
getImplementation in class CRaSHPlugin<CommandManager>
Returns:
the implementation

getExtensions

public Set<String> getExtensions()
Description copied from interface: CommandManager
Returns the set of extensions managed by this implementation.

Specified by:
getExtensions in interface CommandManager
Returns:
the set of extensions, for instance ("groovy")

resolveCommand

public CommandResolution resolveCommand(String name,
                                        byte[] source)
                                 throws CommandCreationException,
                                        NullPointerException
Description copied from interface: CommandManager
Resolve a command for the specified command name.

Specified by:
resolveCommand in interface CommandManager
Parameters:
name - the command name
source - the command source @return the command or null if no command can be resolved
Throws:
CommandCreationException - when the command exists but cannot be created
NullPointerException - if the command name is null

init

public void init(HashMap<String,Object> session)
Specified by:
init in interface CommandManager

destroy

public void destroy(HashMap<String,Object> session)
Specified by:
destroy in interface CommandManager

doCallBack

public String doCallBack(HashMap<String,Object> session,
                         String name,
                         String defaultValue)
Specified by:
doCallBack in interface CommandManager


Copyright © 2014 eXo Platform SAS. All Rights Reserved.