org.crsh.lang.impl
Class LanguageProxy

java.lang.Object
  extended by org.crsh.plugin.CRaSHPlugin<Language>
      extended by org.crsh.lang.impl.LanguageProxy
All Implemented Interfaces:
Language
Direct Known Subclasses:
GroovyLanguageProxy

public class LanguageProxy
extends CRaSHPlugin<Language>
implements Language

A command manager that is able to load a command manager via reflection.

Author:
Julien Viet

Field Summary
private  String className
          .
private  String name
          .
private  AtomicReference<Language> real
          .
 
Fields inherited from class org.crsh.plugin.CRaSHPlugin
CONSTRUCTED, FAILED, INITIALIZED, INITIALIZING, log
 
Constructor Summary
LanguageProxy(String name, String className)
           
 
Method Summary
 void destroy(ShellSession session)
          Destroy session callback.
 Compiler getCompiler()
           
 String getDisplayName()
           
 Language getImplementation()
          Returns the implementation.
 String getName()
           
 Repl getRepl()
           
 void init()
          Implement this method to know about init life cycle callback.
 void init(ShellSession session)
          Init session callback.
 boolean isActive()
           
 
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

real

private final AtomicReference<Language> real
.


name

private final String name
.


className

private final String className
.

Constructor Detail

LanguageProxy

public LanguageProxy(String name,
                     String className)
Method Detail

getImplementation

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

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

init

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

Overrides:
init in class CRaSHPlugin<Language>

getName

public String getName()
Specified by:
getName in interface Language
Returns:
the language name

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface Language
Returns:
the language display name, including the version if possible

isActive

public boolean isActive()
Specified by:
isActive in interface Language
Returns:
true if this language is active. Implementation can decide based on the runtime, for instance the Groovy language can be inactive when the Groovy runtime is not available

getRepl

public Repl getRepl()
Specified by:
getRepl in interface Language
Returns:
the repl for this language, null should be returned when the language does not support the repl feature

getCompiler

public Compiler getCompiler()
Specified by:
getCompiler in interface Language
Returns:
the compiler for this language, null should be returned when the language does not support the compilation feature

init

public void init(ShellSession session)
Description copied from interface: Language
Init session callback.

Specified by:
init in interface Language
Parameters:
session - the initialized session

destroy

public void destroy(ShellSession session)
Description copied from interface: Language
Destroy session callback.

Specified by:
destroy in interface Language
Parameters:
session - the destroyed session


Copyright © 2015 eXo Platform SAS. All Rights Reserved.