org.crsh.shell.impl.command.spi
Interface CommandManager

All Known Implementing Classes:
CommandManagerProxy, GroovyCommandManager, GroovyCommandManagerImpl, JavaCommandManager

public interface CommandManager

Author:
Julien Viet

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.
 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.
 

Method Detail

isActive

boolean isActive()
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.

Returns:
the active status

getExtensions

Set<String> getExtensions()
Returns the set of extensions managed by this implementation.

Returns:
the set of extensions, for instance ("groovy")

resolveCommand

CommandResolution resolveCommand(String name,
                                 byte[] source)
                                 throws CommandCreationException,
                                        NullPointerException
Resolve a command for the specified command name.

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

void init(HashMap<String,Object> session)

destroy

void destroy(HashMap<String,Object> session)

doCallBack

String doCallBack(HashMap<String,Object> session,
                  String name,
                  String defaultValue)


Copyright © 2014 eXo Platform SAS. All Rights Reserved.