org.norther.tammi.core.scripter.lang
Class ScriptManager

java.lang.Object
  extended by org.apache.bsf.BSFManager
      extended by org.norther.tammi.core.scripter.lang.ScriptManager

public class ScriptManager
extends org.apache.bsf.BSFManager

An extended BSF manager.

Version:
$Id: ScriptManager.java,v 1.10 2009/09/28 15:08:46 cvsimp Exp $
Author:
Ilkka Priha

Field Summary
 
Fields inherited from class org.apache.bsf.BSFManager
classLoader, classPath, declaredBeans, extn2Lang, loadedEngines, objectRegistry, pcs, registeredEngines, tempDir, version
 
Constructor Summary
ScriptManager()
          Constructs a new manager.
 
Method Summary
protected  List<org.apache.bsf.BSFDeclaredBean> getDeclaredBeans()
          Gets declared beans.
 String getEngineClassName(String lang)
          Gets the class name of a registered engine.
protected  Map<String,org.apache.bsf.BSFEngine> getLoadedEngines()
          Gets loaded engines.
 boolean isLanguageLoadable(String lang)
          Checks whether a scripting engine for the specified language is registered and loadable.
 org.apache.bsf.BSFEngine loadScriptingEngine(String lang)
          Loads a BSF engine for the specified language.
 org.apache.bsf.BSFEngine loadScriptingEngine(String lang, org.apache.bsf.BSFEngine engine)
          Loads an existing BSF engine.
 void reinitialize()
          Reinitializes all engines ignoring exceptions.
 void reinitialize(String lang)
          Reinitializes an existing BSF engine ignoring exceptions.
 
Methods inherited from class org.apache.bsf.BSFManager
apply, compileApply, compileExpr, compileScript, declareBean, eval, exec, getClassLoader, getClassPath, getLangFromFilename, getObjectRegistry, getTempDir, getVersion, iexec, isLanguageRegistered, lookupBean, registerBean, registerScriptingEngine, setClassLoader, setClassPath, setObjectRegistry, setTempDir, terminate, undeclareBean, unregisterBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScriptManager

public ScriptManager()
Constructs a new manager.

Method Detail

getEngineClassName

public String getEngineClassName(String lang)
Gets the class name of a registered engine.

Parameters:
lang - the language.
Returns:
the class name or null.

loadScriptingEngine

public org.apache.bsf.BSFEngine loadScriptingEngine(String lang)
                                             throws org.apache.bsf.BSFException
Loads a BSF engine for the specified language.

Overrides:
loadScriptingEngine in class org.apache.bsf.BSFManager
Parameters:
lang - the language.
Returns:
the loaded engine.
Throws:
org.apache.bsf.BSFException - on errors.

loadScriptingEngine

public org.apache.bsf.BSFEngine loadScriptingEngine(String lang,
                                                    org.apache.bsf.BSFEngine engine)
                                             throws org.apache.bsf.BSFException
Loads an existing BSF engine.

Parameters:
lang - the language.
engine - the engine.
Returns:
the previous engine, if any.
Throws:
org.apache.bsf.BSFException - on errors.

isLanguageLoadable

public boolean isLanguageLoadable(String lang)
Checks whether a scripting engine for the specified language is registered and loadable.

Parameters:
lang - the language.
Returns:
true if available, false otherwise.

reinitialize

public void reinitialize(String lang)
Reinitializes an existing BSF engine ignoring exceptions.

Parameters:
lang - the language.

reinitialize

public void reinitialize()
Reinitializes all engines ignoring exceptions.


getLoadedEngines

protected Map<String,org.apache.bsf.BSFEngine> getLoadedEngines()
Gets loaded engines.

Returns:
a map of loaded engines.

getDeclaredBeans

protected List<org.apache.bsf.BSFDeclaredBean> getDeclaredBeans()
Gets declared beans.

Returns:
a list of declared beans.


Copyright © 2004 The Norther Organization. All rights reserved.