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

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mentawai.core.ApplicationManager
ApplicationManager.Environment
 
Field Summary
static String DEFAULT_SCRIPT_NAME
          The name of the script file.
static 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, ADD, AJAX, ALREADY, APPLICATION, BACK, BLOCKED, container, CONTEXT_PATH, CREATED, DEFAULT_ENVIRONMENT, EDIT, ERROR, EXCEPTION, EXTENSION, HTML, INDEX, INPUT, JSON, JSP, LIST, LOGIN, MAIN, MENTAWAI_BUILD, MENTAWAI_VERSION, NEXT, NOT_FOUND, OUTPUT, PORT, REDIR, REMOVED, REQUEST, SESSION, SHOW, STREAM, SUCCESS, TEST, UPDATED, XML
 
Constructor Summary
BshApplicationManager()
           
 
Method Summary
protected  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(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, addLists, addLists, addLocale, addLocale, addLocales, addLocales, addLocalizedLists, addLocalizedLists, ajax, autowire, autowire, autowire, autoWiring, autoWiring, aw, aw, bean, chain, chain, chain, chain, configureActions, createConnectionHandler, createJPAHandler, createSessionHandler, destroy, di, di, exception, filter, filter, filter, filter, filter, filterLast, filterLast, filterLast, fwd, fwd, getActionConfig, getActionConfig, getActions, getApplication, getBeanConfig, getBeanManager, getComponent, getComponentNames, getComponents, getConnectionHandler, getConsequenceProvider, getContainer, getContextPath, getDefaultAction, getDependencies, getEnvironment, getExtension, getGlobalConsequence, getGlobalFilters, getGlobalFilters, getGlobalFilters, getInstance, getParent, getProperties, getProps, getProps, getRealPath, getReqCharEncoding, getViewDir, init, internal, ioc, ioc, ioc, ioc, ioc, ioc, ioc, ioc, ioc, ioc, ioc, ioc, loadActions, loadBeans, loadFilters, loadFormatters, loadLists, loadLocales, on, on, onStarted, redir, redir, redir, redir, redir, redir, redir, redir, redir, redir, removeActionConfig, removeActionPackage, reset, result, ruby, ruby, ruby, setAutoView, setAutowireEverything, setConnectionHandler, setConsequenceProvider, setDateMaskForEverything, setDebugMode, setDebugMode, setDefaultAction, setEnvironment, setJPAHandler, setRealPath, setReloadable, setRemoveActionFromName, setReqCharEncoding, setSessionHandler, setStatsMode, setupDB, setupIoC, setViewDir, setWebappPath, spring, spring, stream, string, 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 String DEFAULT_SCRIPT_NAME
The name of the script file.

See Also:
Constant Field Values

METHOD_NAME

public static final 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 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(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 © 2013. All Rights Reserved.