org.mentawai.core
Class GroovyApplicationManager

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

public class GroovyApplicationManager
extends ScriptApplicationManager

Author:
Rubem Azenha

Field Summary
 
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
GroovyApplicationManager()
           
 
Method Summary
 ActionConfig action(java.lang.Class klass)
          Convenient method that provides a less verbose way to create a ClassActionConfig.
 ActionConfig action(java.lang.Class klass, java.lang.String innerAction)
          Convenient method that provides a less verbose way to create a ClassActionConfig.
 ActionConfig action(java.lang.String name, java.lang.Class klass)
          Convenient method that provides a less verbose way to create an action config.
 ActionConfig action(java.lang.String name, java.lang.Class klass, java.lang.String innerAction)
          Convenient method that provides a less verbose way to create an action config.
 ActionConfig add(ActionConfig ac)
          Shorter version of addActionConfig.
 Component add(java.lang.String name, Component comp)
          Add an IOC component to this application manager.
 ActionConfig addActionConfig(ActionConfig ac)
          Register an ActionConfig for the Mentawai controller.
 Component addComponent(java.lang.String name, Component comp)
          Add an IOC component to this application manager.
 void addGlobalConsequence(java.lang.String result, Consequence c)
          Register a consequence for all actions in this application manager.
 void addGlobalFilter(Filter filter)
          Register a filter for all actions in this application manager.
 void addGlobalFilter(Filter filter, boolean last)
          Register a filter for all actions in this application manager.
 void addGlobalFilter(java.util.List filters)
          Register a list of filters for all actions in this application manager.
 void addGlobalFilter(java.util.List filters, boolean last)
          Register a list of filters for all actions in this application manager.
 void destroy(Context application)
          Called by the controller when the application is exiting.
 void filter(Filter filter)
          Shorter version of addGlobalFilter.
 void filter(Filter filter, boolean last)
          Shorter version of addGlobalFilter.
 void filter(java.util.List filters)
          Shorter version of addGlobalFilter.
 void filter(java.util.List filters, boolean last)
          Shorter version of addGlobalFilter.
 void filterLast(Filter filter)
          Shorter version of addFlobalFilter.
 void filterLast(java.util.List filters)
          Shorter version of addGlobalFilter.
 ActionConfig getActionConfig(java.lang.String name)
          Gets the ActionConfig with the given name or alias.
 ActionConfig getActionConfig(java.lang.String name, java.lang.String innerAction)
          Gets the Inner ActionConfig with the given name and inner action.
 ApplicationManager getAppManager()
           
 Component getComponent(java.lang.String name)
          Gets an IOC component from this application manager.
 Consequence getGlobalConsequence(java.lang.String result)
          Gets a global consequence associated with the result.
 java.util.List<Filter> getGlobalFilters()
          Gets all the global filters registered in this application manager.
 java.util.List<Filter> getGlobalFilters(boolean last)
          Gets the global filters registered in this application manager.
 java.util.List<Filter> getGlobalFilters(java.lang.Class<? extends java.lang.Object> klass, boolean last)
           
protected  java.lang.String getScriptName()
          Returns the file name of the Script that implements the ApplicationManager.
 void init(Context application)
          Override this method to do any initialization for your web application.
 DefaultComponent ioc(java.lang.String name, java.lang.Class<? extends java.lang.Object> klass)
          Add an IOC component to this application manager.
 ScopeComponent ioc(java.lang.String name, java.lang.Class klass, int scope)
          Add an IOC component to this application manager.
 Component ioc(java.lang.String name, Component comp)
          Add an IOC component to this application manager.
 void loadActions()
          Override this method to register actions and filters in this application manager.
 void loadBeans()
          Override this method to register your mentabeans.
 void loadLists()
          Override this method to control the data list loading process.
 void loadLocales()
          Override this method to specify the supported locales for your application.
 void on(java.lang.String result, Consequence c)
          Shorter version of addGlobalConsequence.
 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.
 void setDebugMode(boolean debugMode)
          Turn on/off the debug mode here.
 void setDebugMode(boolean debugMode, boolean commented)
          Turn on/off the debug mode here.
 void setReloadMode(boolean reloadMode)
          Set reload mode to false if you don't want this class to check if the script was modified and force a reload at runtime.
 ActionConfig spring(java.lang.String path, java.lang.String action)
          Convenient method that provides a less verbose way to create a SpringActionConfig.
 
Methods inherited from class org.mentawai.core.ScriptApplicationManager
getFilename, runScript
 
Methods inherited from class org.mentawai.core.ApplicationManager
addActionPackage, addBeanConfig, addDependency, addDependency, addGlobalFilter, addList, addList, ajax, autoWiring, autoWiring, aw, aw, bean, chain, chain, chain, chain, configureActions, di, di, filter, filterLast, fwd, getActions, getApplication, getBeanConfig, getDefaultAction, getDependencies, getInstance, getProperties, getRealPath, getReqCharEncoding, getViewDir, init, loadFormatters, on, redir, redir, redir, redir, removeActionConfig, removeActionPackage, reset, ruby, ruby, ruby, setAutoView, setConsequenceProvider, setDateMaskForEverything, setDefaultAction, setRealPath, setReloadable, setReqCharEncoding, setStatsMode, setViewDir, stream, string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroovyApplicationManager

public GroovyApplicationManager()
Method Detail

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.

getAppManager

public ApplicationManager getAppManager()

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.

action

public ActionConfig action(java.lang.Class klass,
                           java.lang.String innerAction)
Description copied from class: ApplicationManager
Convenient method that provides a less verbose way to create a ClassActionConfig. Note: This will also add the action to this ApplicationManager, in other words, no need to call add or addActionConfig !!!

Overrides:
action in class ApplicationManager
Returns:
a new ClassActionConfig

action

public ActionConfig action(java.lang.Class klass)
Description copied from class: ApplicationManager
Convenient method that provides a less verbose way to create a ClassActionConfig. Note: This will also add the action to this ApplicationManager, in other words, no need to call add or addActionConfig !!!

Overrides:
action in class ApplicationManager
Returns:
a new ActionConfig

action

public ActionConfig action(java.lang.String name,
                           java.lang.Class klass,
                           java.lang.String innerAction)
Description copied from class: ApplicationManager
Convenient method that provides a less verbose way to create an action config. Note: This will also add the action to this ApplicationManager, in other words, no need to call add or addActionConfig !!!

Overrides:
action in class ApplicationManager
Returns:
a new action config

action

public ActionConfig action(java.lang.String name,
                           java.lang.Class klass)
Description copied from class: ApplicationManager
Convenient method that provides a less verbose way to create an action config. Note: This will also add the action to this ApplicationManager, in other words, no need to call add or addActionConfig !!!

Overrides:
action in class ApplicationManager
Returns:
a new action config

add

public ActionConfig add(ActionConfig ac)
Description copied from class: ApplicationManager
Shorter version of addActionConfig.

Overrides:
add in class ApplicationManager
Returns:
The ActionConfig it receives

add

public Component add(java.lang.String name,
                     Component comp)
Description copied from class: ApplicationManager
Add an IOC component to this application manager.

Overrides:
add in class ApplicationManager
Returns:
The component just added

addActionConfig

public ActionConfig addActionConfig(ActionConfig ac)
Description copied from class: ApplicationManager
Register an ActionConfig for the Mentawai controller. Note: Starting from version 1.2, this method is returning the action config it receives.

Overrides:
addActionConfig in class ApplicationManager
Parameters:
ac - The ActionConfig to register
Returns:
The ActionConfig it receives to register

addComponent

public Component addComponent(java.lang.String name,
                              Component comp)
Description copied from class: ApplicationManager
Add an IOC component to this application manager.

Overrides:
addComponent in class ApplicationManager
Returns:
The component just added

addGlobalConsequence

public void addGlobalConsequence(java.lang.String result,
                                 Consequence c)
Description copied from class: ApplicationManager
Register a consequence for all actions in this application manager. A global consequence has precedence over action consequences.

Overrides:
addGlobalConsequence in class ApplicationManager
Parameters:
result - The result for what a global consequence will be registered
c - The consequence to register as a global consequence

addGlobalFilter

public void addGlobalFilter(Filter filter,
                            boolean last)
Description copied from class: ApplicationManager
Register a filter for all actions in this application manager.

Overrides:
addGlobalFilter in class ApplicationManager
Parameters:
filter - The filter to register as a global filter.
last - true if you want this filter to be executed after the specific action filters.

addGlobalFilter

public void addGlobalFilter(Filter filter)
Description copied from class: ApplicationManager
Register a filter for all actions in this application manager. The filters registered with this method will be executed before the specific action filters.

Overrides:
addGlobalFilter in class ApplicationManager
Parameters:
filter - The filter to register as a global filter.

addGlobalFilter

public void addGlobalFilter(java.util.List filters,
                            boolean last)
Description copied from class: ApplicationManager
Register a list of filters for all actions in this application manager.

Overrides:
addGlobalFilter in class ApplicationManager
Parameters:
filters - A list of filters.
last - true if you want these filters to be executed after the specific action filters.

addGlobalFilter

public void addGlobalFilter(java.util.List filters)
Description copied from class: ApplicationManager
Register a list of filters for all actions in this application manager. The filters registered with this method will be executed before the specific action filters.

Overrides:
addGlobalFilter in class ApplicationManager
Parameters:
filters - A list of filters.

destroy

public void destroy(Context application)
Description copied from class: ApplicationManager
Called by the controller when the application is exiting. OBS: This is called by the Controller servlet's destroy method.

Overrides:
destroy in class ApplicationManager

filter

public void filter(Filter filter,
                   boolean last)
Description copied from class: ApplicationManager
Shorter version of addGlobalFilter.

Overrides:
filter in class ApplicationManager

filter

public void filter(Filter filter)
Description copied from class: ApplicationManager
Shorter version of addGlobalFilter.

Overrides:
filter in class ApplicationManager

filter

public void filter(java.util.List filters,
                   boolean last)
Description copied from class: ApplicationManager
Shorter version of addGlobalFilter.

Overrides:
filter in class ApplicationManager

filter

public void filter(java.util.List filters)
Description copied from class: ApplicationManager
Shorter version of addGlobalFilter.

Overrides:
filter in class ApplicationManager

filterLast

public void filterLast(Filter filter)
Description copied from class: ApplicationManager
Shorter version of addFlobalFilter.

Overrides:
filterLast in class ApplicationManager

filterLast

public void filterLast(java.util.List filters)
Description copied from class: ApplicationManager
Shorter version of addGlobalFilter.

Overrides:
filterLast in class ApplicationManager

getActionConfig

public ActionConfig getActionConfig(java.lang.String name,
                                    java.lang.String innerAction)
Description copied from class: ApplicationManager
Gets the Inner ActionConfig with the given name and inner action.

Overrides:
getActionConfig in class ApplicationManager
Parameters:
name - The name of the ActionConfig
innerAction - The inner action of the ActionConfig.
Returns:
The Inner ActionConfig associated with the given name and inner action.

getActionConfig

public ActionConfig getActionConfig(java.lang.String name)
Description copied from class: ApplicationManager
Gets the ActionConfig with the given name or alias.

Overrides:
getActionConfig in class ApplicationManager
Parameters:
name - The name of the ActionConfig
Returns:
The ActionConfig associated with the given name

getComponent

public Component getComponent(java.lang.String name)
Description copied from class: ApplicationManager
Gets an IOC component from this application manager.

Overrides:
getComponent in class ApplicationManager
Returns:
The ioc component

getGlobalConsequence

public Consequence getGlobalConsequence(java.lang.String result)
Description copied from class: ApplicationManager
Gets a global consequence associated with the result.

Overrides:
getGlobalConsequence in class ApplicationManager
Parameters:
result - The result for what to get a global consequence.
Returns:
A global consequence for the result.

getGlobalFilters

public java.util.List<Filter> getGlobalFilters()
Description copied from class: ApplicationManager
Gets all the global filters registered in this application manager. Note that it will sum up in a list the filters executed before and after the specific action filters.

Overrides:
getGlobalFilters in class ApplicationManager
Returns:
A java.util.List with all the filters registered in this application manager.

getGlobalFilters

public java.util.List<Filter> getGlobalFilters(java.lang.Class<? extends java.lang.Object> klass,
                                               boolean last)
Overrides:
getGlobalFilters in class ApplicationManager

getGlobalFilters

public java.util.List<Filter> getGlobalFilters(boolean last)
Description copied from class: ApplicationManager
Gets the global filters registered in this application manager.

Overrides:
getGlobalFilters in class ApplicationManager
Parameters:
last - true if you want the global filters registered to be executed after the specific action filters.
Returns:
A java.util.List with all the filters registered in this application manager.

init

public void init(Context application)
Description copied from class: ApplicationManager
Override this method to do any initialization for your web application.

Overrides:
init in class ApplicationManager
Parameters:
application - The application context of your web application.

ioc

public ScopeComponent ioc(java.lang.String name,
                          java.lang.Class klass,
                          int scope)
Description copied from class: ApplicationManager
Add an IOC component to this application manager.

Overrides:
ioc in class ApplicationManager
Returns:
The component just added

ioc

public DefaultComponent ioc(java.lang.String name,
                            java.lang.Class<? extends java.lang.Object> klass)
Description copied from class: ApplicationManager
Add an IOC component to this application manager.

Overrides:
ioc in class ApplicationManager
Returns:
The component just added

ioc

public Component ioc(java.lang.String name,
                     Component comp)
Description copied from class: ApplicationManager
Add an IOC component to this application manager.

Overrides:
ioc in class ApplicationManager
Returns:
The component just added

loadActions

public void loadActions()
Description copied from class: ApplicationManager
Override this method to register actions and filters in this application manager.

Overrides:
loadActions in class ApplicationManager

loadBeans

public void loadBeans()
Description copied from class: ApplicationManager
Override this method to register your mentabeans.

Overrides:
loadBeans in class ApplicationManager

loadLists

public void loadLists()
               throws java.io.IOException
Description copied from class: ApplicationManager
Override this method to control the data list loading process.

Overrides:
loadLists in class ApplicationManager
Throws:
java.io.IOException

loadLocales

public void loadLocales()
Description copied from class: ApplicationManager
Override this method to specify the supported locales for your application.

Overrides:
loadLocales in class ApplicationManager

on

public void on(java.lang.String result,
               Consequence c)
Description copied from class: ApplicationManager
Shorter version of addGlobalConsequence.

Overrides:
on in class ApplicationManager

setDebugMode

public void setDebugMode(boolean debugMode,
                         boolean commented)
Description copied from class: ApplicationManager
Turn on/off the debug mode here. This can also be done in the web.xml file.

Overrides:
setDebugMode in class ApplicationManager

setDebugMode

public void setDebugMode(boolean debugMode)
Description copied from class: ApplicationManager
Turn on/off the debug mode here. This can also be done in the web.xml file.

Overrides:
setDebugMode in class ApplicationManager

setReloadMode

public void setReloadMode(boolean reloadMode)
Description copied from class: ScriptApplicationManager
Set reload mode to false if you don't want this class to check if the script was modified and force a reload at runtime.

Overrides:
setReloadMode in class ScriptApplicationManager
Parameters:
reloadMode - a flag to indicate if reload mode is on or off

spring

public ActionConfig spring(java.lang.String path,
                           java.lang.String action)
Description copied from class: ApplicationManager
Convenient method that provides a less verbose way to create a SpringActionConfig. Note: This will also add the action to this ApplicationManager, in other words, no need to call add or addActionConfig !!!

Overrides:
spring in class ApplicationManager
Returns:
a new SpringActionConfig


Copyright © 2005 Mentawai Team. All Rights Reserved.