org.mentawai.core
Class BshApplicationManager

java.lang.Object
  extended by org.mentawai.core.ApplicationManager
      extended by org.mentawai.core.ScriptApplicationManager
          extended by org.mentawai.core.BshApplicationManager

public class BshApplicationManager
extends ScriptApplicationManager

A ScriptApplicationManager that executes a BeanShell script file to configure itself.

Author:
Sergio Oliveira

Field Summary
static java.lang.String DEFAULT_SCRIPT_NAME
          The name of the script file.
static java.lang.String METHOD_NAME
          The method name inside the script file to execute.
 
Fields inherited from class org.mentawai.core.ScriptApplicationManager
file, filename, reload
 
Fields inherited from class org.mentawai.core.ApplicationManager
ACCESSDENIED, ACTION, ALREADY, APPLICATION, BLOCKED, CREATED, ERROR, EXCEPTION, EXTENSION, INDEX, INPUT, JSP, LIST, LOGIN, MAIN, MENTAWAI_BUILD, MENTAWAI_VERSION, OUTPUT, REDIR, REMOVED, REQUEST, SESSION, SHOW, SUCCESS, TEST, UPDATED
 
Constructor Summary
BshApplicationManager()
           
 
Method Summary
protected  java.lang.String getScriptName()
          Returns the file name of the Script that implements the ApplicationManager.
 void init(Context application)
          Here we are just calling setScriptName(DEFAULT_SCRIPT_NAME) and runScript(application).
protected  void prepareScript(bsh.Interpreter i)
           
 void runScript(java.lang.String scriptFile, Context application)
          Subclasses should override this method to implement the details of how to execute the script from Java.
 
Methods inherited from class org.mentawai.core.ScriptApplicationManager
getFilename, runScript, setReloadMode
 
Methods inherited from class org.mentawai.core.ApplicationManager
action, action, action, action, add, add, addActionConfig, addActionPackage, addBeanConfig, addComponent, addDependency, addDependency, addGlobalConsequence, addGlobalFilter, addGlobalFilter, addGlobalFilter, addGlobalFilter, addGlobalFilter, addList, addList, ajax, autoWiring, autoWiring, aw, aw, bean, chain, chain, chain, chain, configureActions, destroy, di, di, filter, filter, filter, filter, filter, filterLast, filterLast, filterLast, fwd, getActionConfig, getActionConfig, getActions, getApplication, getBeanConfig, getComponent, getDefaultAction, getDependencies, getGlobalConsequence, getGlobalFilters, getGlobalFilters, getGlobalFilters, getInstance, getProperties, getRealPath, getReqCharEncoding, getViewDir, init, ioc, ioc, ioc, loadActions, loadBeans, loadFormatters, loadLists, loadLocales, on, on, redir, redir, redir, redir, removeActionConfig, removeActionPackage, reset, ruby, ruby, ruby, setAutoView, setConsequenceProvider, setDateMaskForEverything, setDebugMode, setDebugMode, setDefaultAction, setRealPath, setReloadable, setReqCharEncoding, setStatsMode, setViewDir, spring, stream, string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SCRIPT_NAME

public static final java.lang.String DEFAULT_SCRIPT_NAME
The name of the script file.

See Also:
Constant Field Values

METHOD_NAME

public static final java.lang.String METHOD_NAME
The method name inside the script file to execute.

See Also:
Constant Field Values
Constructor Detail

BshApplicationManager

public BshApplicationManager()
Method Detail

init

public void init(Context application)
Here we are just calling setScriptName(DEFAULT_SCRIPT_NAME) and runScript(application).

Overrides:
init in class ApplicationManager
Parameters:
application - The application context for this web application.

getScriptName

protected java.lang.String getScriptName()
Description copied from class: ScriptApplicationManager
Returns the file name of the Script that implements the ApplicationManager.

Specified by:
getScriptName in class ScriptApplicationManager
Returns:
the script file name.

prepareScript

protected void prepareScript(bsh.Interpreter i)
                      throws bsh.EvalError
Throws:
bsh.EvalError

runScript

public void runScript(java.lang.String scriptFile,
                      Context application)
Description copied from class: ScriptApplicationManager
Subclasses should override this method to implement the details of how to execute the script from Java. The actual script Java interpreter is called here to load and run the script file.

Specified by:
runScript in class ScriptApplicationManager
Parameters:
scriptFile - The absolute path to the script file.
application - The application context for this web application.


Copyright © 2005 Mentawai Team. All Rights Reserved.