org.mentawai.core
Class ApplicationManager

java.lang.Object
  extended by org.mentawai.core.ApplicationManager
Direct Known Subclasses:
CoCApplicationManager, DefaultApplicationManager, MultiApplicationManager, ScriptApplicationManager

public abstract class ApplicationManager
extends Object

The central abstract base manager which controls actions, filters, locales and data lists. You can use this class to register actions and filters through the loadActions() method. You can use this class to specify supported locales through the loadLocales() method. You can use this class to manage the data list loading process. You can use this class to initialize anything for your web application.

Author:
Sergio Oliveira Jr., Fernando Boaglio

Nested Class Summary
static class ApplicationManager.Environment
           
 
Field Summary
static String ACCESSDENIED
           
static int ACTION
           
static String ADD
           
static String AJAX
           
static String ALREADY
           
static int APPLICATION
           
static String BACK
           
static String BLOCKED
           
protected static org.mentacontainer.Container container
           
static String CONTEXT_PATH
           
static String CREATED
           
static ApplicationManager.Environment DEFAULT_ENVIRONMENT
           
static String EDIT
           
static String ERROR
           
static String EXCEPTION
           
static String EXTENSION
           
static String HTML
           
static String INDEX
           
static int INPUT
           
static String JSON
           
static String JSP
           
static String LIST
           
static String LOGIN
           
static String MAIN
           
static String MENTAWAI_BUILD
           
static String MENTAWAI_VERSION
           
static String NEXT
           
static String NOT_FOUND
           
static int OUTPUT
           
static int PORT
           
static String REDIR
           
static String REMOVED
           
static int REQUEST
           
static int SESSION
           
static String SHOW
           
static String STREAM
           
static String SUCCESS
           
static String TEST
           
static String UPDATED
           
static String XML
           
 
Constructor Summary
ApplicationManager()
          Default constructor
 
Method Summary
 ActionConfig action(Class<? extends Object> klass)
          Convenient method that provides a less verbose way to create a ClassActionConfig.
 ActionConfig action(Class<? extends Object> klass, String innerAction)
          Convenient method that provides a less verbose way to create a ClassActionConfig.
 ActionConfig action(String name, Class<? extends Object> klass)
          Convenient method that provides a less verbose way to create an action config.
 ActionConfig action(String name, Class<? extends Object> klass, String innerAction)
          Convenient method that provides a less verbose way to create an action config.
 ActionConfig add(ActionConfig ac)
          Shorter version of addActionConfig.
 Bean add(String name, Bean comp)
          Add an IOC component to this application manager.
 ActionConfig addActionConfig(ActionConfig ac)
          Register an ActionConfig for the Mentawai controller.
 void addActionPackage(String actionPackage)
           
 org.mentabean.BeanConfig addBeanConfig(org.mentabean.BeanConfig bc)
           
 Bean addComponent(String name, Bean comp)
          Add an IOC component to this application manager.
 Dependency addDependency(Class<? extends Object> klass, String target)
           
 Dependency addDependency(Class<? extends Object> klass, String target, String source)
           
 void addGlobalConsequence(String result, Consequence c)
          Register a consequence for all actions in this application manager.
 void addGlobalFilter(Class<? extends Object> klass, Filter filter, boolean last)
           
 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(List filters)
          Register a list of filters for all actions in this application manager.
 void addGlobalFilter(List filters, boolean last)
          Register a list of filters for all actions in this application manager.
 void addList(DBListData list, ConnectionHandler connHandler)
          Adds the list to the ListManager, so there is no need to use ListManager.addList
 void addList(ListData listData)
          Adds the list to this ListManager, so there is no need to use ListManager.addList
 void addLists(ConnectionHandler connHandler, String... lists)
           
 void addLists(String... lists)
           
 void addLocale(Locale loc)
           
 void addLocale(String loc)
           
 void addLocales(Locale... locs)
           
 void addLocales(String... strings)
           
 void addLocalizedLists(ConnectionHandler connHandler, String... lists)
           
 void addLocalizedLists(String... lists)
           
static Consequence ajax(AjaxRenderer renderer)
           
 Dependency autowire(String sourceFromContainer)
           
 Dependency autowire(String target, Class<? extends Object> klass)
           
 Dependency autowire(String target, Class<? extends Object> klass, String source)
           
 Dependency autoWiring(String target, Class<? extends Object> klass)
          Deprecated. Use autowire instead.
 Dependency autoWiring(String target, Class<? extends Object> klass, String source)
          Deprecated. Use autowire instead.
 Dependency aw(String target, Class<? extends Object> klass)
           
 Dependency aw(String target, Class<? extends Object> klass, String source)
           
 org.mentabean.BeanConfig bean(Class<? extends Object> beanClass, String tableName)
           
static Consequence chain(ActionConfig ac)
          Convenient method that provides a less verbose way to create a chain.
static Consequence chain(ActionConfig ac, String innerAction)
          Convenient method that provides a less verbose way to create a chain.
static Consequence chain(Class<? extends Object> klass)
          Convenient method for setting a chain.
static Consequence chain(Class<? extends Object> klass, String innerAction)
          Convenient method for setting a chain.
 void configureActions(String packageName)
          Look inside a package and load all actions classes that implement the interface Configurable.
 ConnectionHandler createConnectionHandler()
           
 JPAHandler createJPAHandler()
           
 SessionHandler createSessionHandler()
           
 void destroy(Context application)
          Called by the controller when the application is exiting.
 Dependency di(String target, Class<? extends Object> klass)
           
 Dependency di(String target, Class<? extends Object> klass, String source)
           
static Consequence exception(String msg)
           
 void filter(Class<? extends Object> klass, Filter filter)
           
 void filter(Filter filter)
          Shorter version of addGlobalFilter.
 void filter(Filter filter, boolean last)
          Shorter version of addGlobalFilter.
 void filter(List filters)
          Shorter version of addGlobalFilter.
 void filter(List filters, boolean last)
          Shorter version of addGlobalFilter.
 void filterLast(Class<? extends Object> klass, Filter filter)
           
 void filterLast(Filter filter)
          Shorter version of addFlobalFilter.
 void filterLast(List filters)
          Shorter version of addGlobalFilter.
static Consequence fwd(ActionConfig ac)
           
static Consequence fwd(String page)
          Convenient method that provides a less verbose way to create a forward.
 ActionConfig getActionConfig(String name)
          Gets the ActionConfig with the given name or alias.
 ActionConfig getActionConfig(String name, String innerAction)
          Gets the Inner ActionConfig with the given name and inner action.
protected  Map<String,ActionConfig> getActions()
           
static Context getApplication()
           
 org.mentabean.BeanConfig getBeanConfig(Class<? extends Object> beanClass)
           
 org.mentabean.BeanManager getBeanManager()
           
 Bean getComponent(String name)
          Gets an IOC component from this application manager.
 Set<String> getComponentNames()
           
 Map<String,Bean> getComponents()
           
 ConnectionHandler getConnectionHandler()
           
 ConsequenceProvider getConsequenceProvider()
          Get the consequence provider that will be used by the controller.
static org.mentacontainer.Container getContainer()
           
static String getContextPath()
           
static ActionConfig getDefaultAction()
           
 Iterator<Dependency> getDependencies()
           
 ApplicationManager.Environment getEnvironment()
           
static String getExtension()
           
 Consequence getGlobalConsequence(String result)
          Gets a global consequence associated with the result.
 List<Filter> getGlobalFilters()
          Gets all the global filters registered in this application manager.
 List<Filter> getGlobalFilters(boolean last)
          Gets the global filters registered in this application manager.
 List<Filter> getGlobalFilters(Class<? extends Object> klass, boolean last)
           
static ApplicationManager getInstance()
           
 ApplicationManager getParent()
          Retorna o ApplicationManager que registou esse ApplicationManager.
 Props getProperties()
           
 Props getProps()
           
 Props getProps(String env)
           
static String getRealPath()
          Returns this web application's real path.
 String getReqCharEncoding()
           
static String getViewDir()
           
 void init()
          Override this method to do any initialization for your web application.
 void init(Context application)
          Override this method to do any initialization for your web application.
 ActionConfig internal(Class<? extends Object> klass, String innerAction)
           
 Bean ioc(Class<?> klass, Bean comp)
           
 ScopeComponent ioc(Class<?> klass, Class<?> k, int scope)
           
 DefaultComponent ioc(Class<?> klass, Class<? extends Object> k)
           
 void ioc(Class<?> klass, org.mentacontainer.Factory c)
           
 void ioc(Class<?> klass, org.mentacontainer.Factory c, org.mentacontainer.Scope s)
           
 void ioc(Class<?> klass, Object singleInstance)
           
 Bean ioc(String name, Bean comp)
          Add an IOC component to this application manager.
 ScopeComponent ioc(String name, Class<?> klass, int scope)
          Add an IOC component to this application manager.
 DefaultComponent ioc(String name, Class<? extends Object> klass)
          Add an IOC component to this application manager.
 void ioc(String name, org.mentacontainer.Factory c)
           
 void ioc(String name, org.mentacontainer.Factory c, org.mentacontainer.Scope s)
           
 void ioc(String name, Object singleInstance)
           
 void loadActions()
          Override this method to register actions and filters in this application manager.
 void loadBeans()
          Override this method to register your mentabeans.
 void loadFilters()
          Override this method to register your Filters.
 void loadFormatters()
          Override this method to define formatters that can be used by mtw:out tag
 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(String result, Consequence c)
          Shorter version of addGlobalConsequence.
 void on(String result, String jsp)
          Shorter verions of addGlobalConsequence that will assume a forward.
 void onStarted(Context context)
           
static Consequence redir()
          Convenient method that provides a less verbose way to create a redirect.
static Consequence redir(ActionConfig ac)
          Redir to an action.
static Consequence redir(ActionConfig ac, boolean flag)
          Redir to an action.
static Consequence redir(boolean flag)
          Convenient method that provides a less verbose way to create a redirect.
static Consequence redir(Class<?> klass)
          Convenient method that provides a less verbose way to create a redirect to a Action.
static Consequence redir(Class<?> klass, boolean appendOutput)
          Convenient method that provides a less verbose way to create a redirect to a Action.
static Consequence redir(Class<?> klass, String innerAction)
          Convenient method that provides a less verbose way to create a redirect to a Action.
static Consequence redir(Class<?> klass, String innerAction, boolean appendOutput)
          Convenient method that provides a less verbose way to create a redirect to a Action.
static Consequence redir(String page)
          Convenient method that provides a less verbose way to create a redirect.
static Consequence redir(String page, boolean flag)
          Convenient method that provides a less verbose way to create a redirect.
 boolean removeActionConfig(ActionConfig ac)
          Remove an action config from this application manager.
 void removeActionPackage(String actionPackage)
           
 void reset()
          Reset this application manager.
static Consequence result()
           
 ActionConfig ruby(String klass)
           
 ActionConfig ruby(String name, String klass)
           
 ActionConfig ruby(String name, String klass, String innerAction)
           
 void setAutoView(boolean autoView)
          Turn on/off auto view discovery.
 void setAutowireEverything(boolean flag)
           
 void setConnectionHandler(ConnectionHandler connHandler)
           
 void setConsequenceProvider(ConsequenceProvider consequenceProvider)
          Sets the consequence provider that will be used by the controller.
 void setDateMaskForEverything(String mask)
          Set default mask for the whole application
 void setDebugMode(boolean debugMode)
          Turn on/off the debug mode here.
 void setDebugMode(boolean debugMode, boolean commented)
          Turn on/off the debug mode here.
static void setDefaultAction(ActionConfig ac)
           
 void setEnvironment(ApplicationManager.Environment env)
           
 void setJPAHandler(JPAHandler jpaHandler)
           
static void setRealPath(String realpath)
           
 void setReloadable(boolean reloadable)
          Turn on/off application manager auto-reload feature.
 void setReloadMode(boolean reloadMode)
          Turn on/off the reload mode of application manager.
static void setRemoveActionFromName(boolean flag)
           
 void setReqCharEncoding(String encoding)
           
 void setSessionHandler(SessionHandler sessionHandler)
           
 void setStatsMode(boolean statsMode)
          Turn on/off the statsMode mode here.
 void setupDB()
           
 void setupIoC()
          Override this method to register your IoC Components.
static void setViewDir(String viewDir)
           
 void setWebappPath(String s)
           
 ActionConfig spring(String path, String action)
          Convenient method that provides a less verbose way to create a SpringActionConfig.
 ActionConfig spring(String path, String action, String innerAction)
          Convenient method that provides a less verbose way to create a SpringActionConfig.
 StreamConsequence stream(String contentType)
           
 StringConsequence string()
           
 StringConsequence string(String key)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SUCCESS

public static final String SUCCESS
See Also:
Constant Field Values

ERROR

public static final String ERROR
See Also:
Constant Field Values

SHOW

public static final String SHOW
See Also:
Constant Field Values

LIST

public static final String LIST
See Also:
Constant Field Values

INDEX

public static final String INDEX
See Also:
Constant Field Values

MAIN

public static final String MAIN
See Also:
Constant Field Values

LOGIN

public static final String LOGIN
See Also:
Constant Field Values

ACCESSDENIED

public static final String ACCESSDENIED
See Also:
Constant Field Values

TEST

public static final String TEST
See Also:
Constant Field Values

JSP

public static final String JSP
See Also:
Constant Field Values

CREATED

public static final String CREATED
See Also:
Constant Field Values

UPDATED

public static final String UPDATED
See Also:
Constant Field Values

REMOVED

public static final String REMOVED
See Also:
Constant Field Values

ALREADY

public static final String ALREADY
See Also:
Constant Field Values

BLOCKED

public static final String BLOCKED
See Also:
Constant Field Values

XML

public static final String XML
See Also:
Constant Field Values

JSON

public static final String JSON
See Also:
Constant Field Values

HTML

public static final String HTML
See Also:
Constant Field Values

ADD

public static final String ADD
See Also:
Constant Field Values

EDIT

public static final String EDIT
See Also:
Constant Field Values

NEXT

public static final String NEXT
See Also:
Constant Field Values

BACK

public static final String BACK
See Also:
Constant Field Values

AJAX

public static final String AJAX
See Also:
Constant Field Values

STREAM

public static final String STREAM
See Also:
Constant Field Values

NOT_FOUND

public static final String NOT_FOUND
See Also:
Constant Field Values

ACTION

public static final int ACTION
See Also:
Constant Field Values

REQUEST

public static final int REQUEST
See Also:
Constant Field Values

INPUT

public static final int INPUT
See Also:
Constant Field Values

OUTPUT

public static final int OUTPUT
See Also:
Constant Field Values

SESSION

public static final int SESSION
See Also:
Constant Field Values

APPLICATION

public static final int APPLICATION
See Also:
Constant Field Values

EXCEPTION

public static final String EXCEPTION

REDIR

public static final String REDIR
See Also:
Constant Field Values

DEFAULT_ENVIRONMENT

public static ApplicationManager.Environment DEFAULT_ENVIRONMENT

MENTAWAI_VERSION

public static String MENTAWAI_VERSION

MENTAWAI_BUILD

public static String MENTAWAI_BUILD

EXTENSION

public static String EXTENSION

CONTEXT_PATH

public static String CONTEXT_PATH

PORT

public static int PORT

container

protected static org.mentacontainer.Container container
Constructor Detail

ApplicationManager

public ApplicationManager()
Default constructor

Method Detail

setConnectionHandler

public void setConnectionHandler(ConnectionHandler connHandler)

setSessionHandler

public void setSessionHandler(SessionHandler sessionHandler)

setJPAHandler

public void setJPAHandler(JPAHandler jpaHandler)

getConnectionHandler

public ConnectionHandler getConnectionHandler()

setEnvironment

public void setEnvironment(ApplicationManager.Environment env)

getEnvironment

public ApplicationManager.Environment getEnvironment()

setRemoveActionFromName

public static void setRemoveActionFromName(boolean flag)

getApplication

public static Context getApplication()

getInstance

public static ApplicationManager getInstance()

setRealPath

public static void setRealPath(String realpath)

setAutowireEverything

public void setAutowireEverything(boolean flag)

setReqCharEncoding

public void setReqCharEncoding(String encoding)

getReqCharEncoding

public String getReqCharEncoding()

getContextPath

public static String getContextPath()

setDefaultAction

public static void setDefaultAction(ActionConfig ac)

getDefaultAction

public static ActionConfig getDefaultAction()

getProperties

public Props getProperties()

getProps

public Props getProps()

getProps

public Props getProps(String env)

stream

public StreamConsequence stream(String contentType)

string

public StringConsequence string(String key)

string

public StringConsequence string()

addActionPackage

public void addActionPackage(String actionPackage)

removeActionPackage

public void removeActionPackage(String actionPackage)

setViewDir

public static void setViewDir(String viewDir)

getViewDir

public static String getViewDir()

getRealPath

public static String getRealPath()
Returns this web application's real path. For example: c:\program files\tomcat\webapps\myapplication

Returns:
The real path

setWebappPath

public void setWebappPath(String s)

getContainer

public static org.mentacontainer.Container getContainer()

reset

public void reset()
Reset this application manager. All configuration (actions, filters, etc) is discarded.


addActionConfig

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

Parameters:
ac - The ActionConfig to register
Returns:
The ActionConfig it receives to register
Throws:
IllegalStateException - if you try to add an action config with no name (internal action config)

addBeanConfig

public org.mentabean.BeanConfig addBeanConfig(org.mentabean.BeanConfig bc)

getBeanConfig

public org.mentabean.BeanConfig getBeanConfig(Class<? extends Object> beanClass)

getBeanManager

public org.mentabean.BeanManager getBeanManager()

bean

public org.mentabean.BeanConfig bean(Class<? extends Object> beanClass,
                                     String tableName)

removeActionConfig

public boolean removeActionConfig(ActionConfig ac)
Remove an action config from this application manager.

Parameters:
ac - The action config to remove
Returns:
true if removed, false if not found
Since:
1.8

add

public ActionConfig add(ActionConfig ac)
Shorter version of addActionConfig.

Parameters:
ac -
Returns:
The ActionConfig it receives
Since:
1.2

init

public void init()
Override this method to do any initialization for your web application.


init

public void init(Context application)
Override this method to do any initialization for your web application.

Parameters:
application - The application context of your web application.
Since:
1.1

destroy

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

Parameters:
application -
Since:
1.4

createConnectionHandler

public ConnectionHandler createConnectionHandler()

createSessionHandler

public SessionHandler createSessionHandler()

createJPAHandler

public JPAHandler createJPAHandler()

setupDB

public void setupDB()

loadFilters

public void loadFilters()
Override this method to register your Filters.


setupIoC

public void setupIoC()
Override this method to register your IoC Components.


loadBeans

public void loadBeans()
Override this method to register your mentabeans.


loadActions

public void loadActions()
Override this method to register actions and filters in this application manager.


loadLocales

public void loadLocales()
Override this method to specify the supported locales for your application.


loadLists

public void loadLists()
               throws Exception
Override this method to control the data list loading process.

Throws:
Exception

loadFormatters

public void loadFormatters()
Override this method to define formatters that can be used by mtw:out tag


onStarted

public void onStarted(Context context)

addLocale

public void addLocale(String loc)

addLocale

public void addLocale(Locale loc)

addLocales

public void addLocales(Locale... locs)

addLocales

public void addLocales(String... strings)

getActionConfig

public ActionConfig getActionConfig(String name)
Gets the ActionConfig with the given name or alias.

Parameters:
name - The name of the ActionConfig
Returns:
The ActionConfig associated with the given name

getActions

protected Map<String,ActionConfig> getActions()

getActionConfig

public ActionConfig getActionConfig(String name,
                                    String innerAction)
Gets the Inner ActionConfig with the given name and inner action.

Parameters:
name - The name of the ActionConfig
innerAction - (Optional) The inner action of the ActionConfig.
Returns:
The Inner ActionConfig associated with the given name and inner action.

addGlobalFilter

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

Parameters:
filter - The filter to register as a global filter.

filter

public void filter(Filter filter)
Shorter version of addGlobalFilter.

Parameters:
filter -
Since:
1.2

addGlobalFilter

public void addGlobalFilter(List filters)
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.

Parameters:
filters - A list of filters.
Since:
1.1.1

filter

public void filter(List filters)
Shorter version of addGlobalFilter.

Parameters:
filters -
Since:
1.2

addGlobalFilter

public void addGlobalFilter(Filter filter,
                            boolean last)
Register a filter for all actions in this application manager.

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.
Since:
1.1.1

addGlobalFilter

public void addGlobalFilter(Class<? extends Object> klass,
                            Filter filter,
                            boolean last)

filter

public void filter(Class<? extends Object> klass,
                   Filter filter)

filterLast

public void filterLast(Class<? extends Object> klass,
                       Filter filter)

filter

public void filter(Filter filter,
                   boolean last)
Shorter version of addGlobalFilter.

Parameters:
filter -
last -
Since:
1.2

filterLast

public void filterLast(Filter filter)
Shorter version of addFlobalFilter.

Parameters:
filter -
Since:
1.3

addGlobalFilter

public void addGlobalFilter(List filters,
                            boolean last)
Register a list of filters for all actions in this application manager.

Parameters:
filters - A list of filters.
last - true if you want these filters to be executed after the specific action filters.
Since:
1.1.1

filter

public void filter(List filters,
                   boolean last)
Shorter version of addGlobalFilter.

Parameters:
filters -
last -
Since:
1.2

filterLast

public void filterLast(List filters)
Shorter version of addGlobalFilter.

Parameters:
filters -
Since:
1.3

addGlobalConsequence

public void addGlobalConsequence(String result,
                                 Consequence c)
Register a consequence for all actions in this application manager. A global consequence has precedence over action consequences.

Parameters:
result - The result for what a global consequence will be registered
c - The consequence to register as a global consequence

on

public void on(String result,
               Consequence c)
Shorter version of addGlobalConsequence.

Parameters:
result -
c -
Since:
1.2

on

public void on(String result,
               String jsp)
Shorter verions of addGlobalConsequence that will assume a forward.

Parameters:
result -
jsp -
Since:
1.9

getGlobalFilters

public List<Filter> getGlobalFilters(boolean last)
Gets the global filters registered in this application manager.

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.
Since:
1.1.1

getGlobalFilters

public List<Filter> getGlobalFilters(Class<? extends Object> klass,
                                     boolean last)

getGlobalFilters

public List<Filter> getGlobalFilters()
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.

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

getGlobalConsequence

public Consequence getGlobalConsequence(String result)
Gets a global consequence associated with the result.

Parameters:
result - The result for what to get a global consequence.
Returns:
A global consequence for the result.

fwd

public static Consequence fwd(String page)
Convenient method that provides a less verbose way to create a forward. This is shorter than new Forward("/foo.jsp").

Parameters:
page -
Returns:
a new forward consequence
Since:
1.2

fwd

public static Consequence fwd(ActionConfig ac)

redir

public static Consequence redir(String page)
Convenient method that provides a less verbose way to create a redirect. This is shorter than new Redirect("/foo.jsp").

Parameters:
page -
Returns:
a new redirect consequence
Since:
1.2

exception

public static Consequence exception(String msg)

result

public static Consequence result()

redir

public static Consequence redir(ActionConfig ac)
Redir to an action.

Parameters:
ac -
Returns:
Consequence
Since:
1.16

redir

public static Consequence redir(Class<?> klass)
Convenient method that provides a less verbose way to create a redirect to a Action. This is shorter than new Redirect("FoobarAction.mtw");
Notice that the action is generated when the pattern above, if you are using a PrettyURLController will not work and is indicated use normal redirect: redir(String, boolean)

Parameters:
klass -
Returns:
a new redirect consequence
Since:
1.15.1

redir

public static Consequence redir(Class<?> klass,
                                boolean appendOutput)
Convenient method that provides a less verbose way to create a redirect to a Action. This is shorter than new Redirect("FoobarAction.mtw");
Notice that the action is generated when the pattern above, if you are using a PrettyURLController will not work and is indicated use normal redirect: redir(String, boolean)

Parameters:
klass -
appendOutput - is true if this redirect is to use dynamic parameters.
Returns:
a new redirect consequence
Since:
1.15.1

redir

public static Consequence redir(Class<?> klass,
                                String innerAction)
Convenient method that provides a less verbose way to create a redirect to a Action. This is shorter than new Redirect("FoobarAction.saveFoo.mtw");
Notice that the action is generated when the pattern above, if you are using a PrettyURLController will not work and is indicated use normal redirect: redir(String, boolean)

Parameters:
klass -
innerAction -
Returns:
a new redirect consequence
Since:
1.15.1

redir

public static Consequence redir(Class<?> klass,
                                String innerAction,
                                boolean appendOutput)
Convenient method that provides a less verbose way to create a redirect to a Action. This is shorter than new Redirect("FoobarAction.saveFoo.mtw");
Notice that the action is generated when the pattern above, if you are using a PrettyURLController will not work and is indicated use normal redirect: redir(String, boolean)

Parameters:
klass -
innerAction -
appendOutput -
Returns:
a new redirect consequence
Since:
1.15.1

redir

public static Consequence redir(String page,
                                boolean flag)
Convenient method that provides a less verbose way to create a redirect. This is shorter than new Redirect("/foo.jsp", true).

Parameters:
page -
flag -
Returns:
a new redirect consequence
Since:
1.3

redir

public static Consequence redir(ActionConfig ac,
                                boolean flag)
Redir to an action.

Parameters:
ac -
flag -
Returns:
Consequence
Since:
1.16

redir

public static Consequence redir()
Convenient method that provides a less verbose way to create a redirect. This is shorter than new Redirect().

Returns:
a new redirect consequence
Since:
1.3

redir

public static Consequence redir(boolean flag)
Convenient method that provides a less verbose way to create a redirect. This is shorter than new Redirect().

Parameters:
flag -
Returns:
a new redirect consequence
Since:
1.4

chain

public static Consequence chain(ActionConfig ac)
Convenient method that provides a less verbose way to create a chain. This is shorter than new Chain("/foo.jsp").

Parameters:
ac - The action config to chain
Returns:
a new chain consequence
Since:
1.2

ajax

public static Consequence ajax(AjaxRenderer renderer)

chain

public static Consequence chain(ActionConfig ac,
                                String innerAction)
Convenient method that provides a less verbose way to create a chain.

Parameters:
ac -
innerAction -
Returns:
a new chain consequence
Since:
1.12

chain

public static Consequence chain(Class<? extends Object> klass)
Convenient method for setting a chain.

Parameters:
klass -
Returns:
a new chain consequence
Since:
1.11

chain

public static Consequence chain(Class<? extends Object> klass,
                                String innerAction)
Convenient method for setting a chain.

Parameters:
klass -
innerAction -
Returns:
a new chain consequence
Since:
1.11

action

public ActionConfig action(Class<? extends Object> klass)
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 !!!

Parameters:
klass -
Returns:
a new ActionConfig
Since:
1.3

ruby

public ActionConfig ruby(String klass)

ruby

public ActionConfig ruby(String name,
                         String klass)

ruby

public ActionConfig ruby(String name,
                         String klass,
                         String innerAction)

spring

public ActionConfig spring(String path,
                           String action)
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 !!!

Parameters:
path -
action -
Returns:
a new SpringActionConfig
Since:
1.3

spring

public ActionConfig spring(String path,
                           String action,
                           String innerAction)
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 !!!

Parameters:
path -
action -
innerAction -
Returns:
a new SpringActionConfig
Since:
1.0

action

public ActionConfig action(String name,
                           Class<? extends Object> klass)
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 !!!

Parameters:
name -
klass -
Returns:
a new action config
Since:
1.2

internal

public ActionConfig internal(Class<? extends Object> klass,
                             String innerAction)

action

public ActionConfig action(String name,
                           Class<? extends Object> klass,
                           String innerAction)
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 !!!

Parameters:
name -
klass -
innerAction -
Returns:
a new action config
Since:
1.2

action

public ActionConfig action(Class<? extends Object> klass,
                           String innerAction)
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 !!!

Parameters:
klass -
innerAction -
Returns:
a new ClassActionConfig
Since:
1.3

setReloadable

public void setReloadable(boolean reloadable)
Turn on/off application manager auto-reload feature. In order for this to work you must me using JRebel to force a class reload. More info here: http://www.jrebel.com

Parameters:
reloadable -

setDebugMode

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

Parameters:
debugMode -

setDebugMode

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

Parameters:
debugMode -
commented -

setStatsMode

public void setStatsMode(boolean statsMode)
Turn on/off the statsMode mode here.

Parameters:
statsMode -

setReloadMode

public void setReloadMode(boolean reloadMode)
Turn on/off the reload mode of application manager. This can also be done in the web.xml file.

Parameters:
reloadMode -

getExtension

public static String getExtension()

autowire

public Dependency autowire(String target,
                           Class<? extends Object> klass,
                           String source)

autowire

public Dependency autowire(String target,
                           Class<? extends Object> klass)

autowire

public Dependency autowire(String sourceFromContainer)

addDependency

public Dependency addDependency(Class<? extends Object> klass,
                                String target,
                                String source)

addDependency

public Dependency addDependency(Class<? extends Object> klass,
                                String target)

di

public Dependency di(String target,
                     Class<? extends Object> klass)

di

public Dependency di(String target,
                     Class<? extends Object> klass,
                     String source)

autoWiring

public Dependency autoWiring(String target,
                             Class<? extends Object> klass)
Deprecated. Use autowire instead.


aw

public Dependency aw(String target,
                     Class<? extends Object> klass,
                     String source)

aw

public Dependency aw(String target,
                     Class<? extends Object> klass)

autoWiring

public Dependency autoWiring(String target,
                             Class<? extends Object> klass,
                             String source)
Deprecated. Use autowire instead.


getDependencies

public Iterator<Dependency> getDependencies()

getComponents

public Map<String,Bean> getComponents()

getComponentNames

public Set<String> getComponentNames()

setAutoView

public void setAutoView(boolean autoView)
Turn on/off auto view discovery. Default is on! This can also be done in the web.xml file. Auto view gives the controller the ability to generate forward consequences automatically for the results it cannot find a consequence, so that you don't need to define consequences for your actions in the configuration.

Parameters:
autoView -

addComponent

public Bean addComponent(String name,
                         Bean comp)
Add an IOC component to this application manager.

Parameters:
name -
comp -
Returns:
The component just added

add

public Bean add(String name,
                Bean comp)
Add an IOC component to this application manager.

Parameters:
name -
comp -
Returns:
The component just added

getComponent

public Bean getComponent(String name)
Gets an IOC component from this application manager.

Parameters:
name -
Returns:
The ioc component

ioc

public Bean ioc(String name,
                Bean comp)
Add an IOC component to this application manager.

Parameters:
name -
comp -
Returns:
The component just added

ioc

public Bean ioc(Class<?> klass,
                Bean comp)

ioc

public void ioc(String name,
                org.mentacontainer.Factory c)

ioc

public void ioc(Class<?> klass,
                org.mentacontainer.Factory c)

ioc

public void ioc(String name,
                Object singleInstance)

ioc

public void ioc(Class<?> klass,
                Object singleInstance)

ioc

public void ioc(String name,
                org.mentacontainer.Factory c,
                org.mentacontainer.Scope s)

ioc

public void ioc(Class<?> klass,
                org.mentacontainer.Factory c,
                org.mentacontainer.Scope s)

ioc

public DefaultComponent ioc(String name,
                            Class<? extends Object> klass)
Add an IOC component to this application manager.

Parameters:
name -
klass -
Returns:
The component just added

ioc

public DefaultComponent ioc(Class<?> klass,
                            Class<? extends Object> k)

ioc

public ScopeComponent ioc(String name,
                          Class<?> klass,
                          int scope)
Add an IOC component to this application manager.

Parameters:
name -
klass -
scope -
Returns:
The component just added

ioc

public ScopeComponent ioc(Class<?> klass,
                          Class<?> k,
                          int scope)

configureActions

public void configureActions(String packageName)
Look inside a package and load all actions classes that implement the interface Configurable. Call the method configure to configure these actions. This is useful if you prefer to place the configuration for an action inside the action itself. OBS: By doing this you are spreading your configuration all over your code, so this is not recommended for serious projects. This boils down to a matter of taste, so Mentawai provides this as well.

Parameters:
packageName -

getParent

public ApplicationManager getParent()
Retorna o ApplicationManager que registou esse ApplicationManager.

Returns:
Uma instância de MultiApplicationManager ou NULL se este for o ApplicationManager de mais auto nível.

setConsequenceProvider

public void setConsequenceProvider(ConsequenceProvider consequenceProvider)
Sets the consequence provider that will be used by the controller.

Parameters:
consequenceProvider -
Since:
1.11

getConsequenceProvider

public ConsequenceProvider getConsequenceProvider()
Get the consequence provider that will be used by the controller.

Since:
2.1.2

addList

public void addList(DBListData list,
                    ConnectionHandler connHandler)
Adds the list to the ListManager, so there is no need to use ListManager.addList

Parameters:
list -
connHandler -
Since:
1.11

addLocalizedLists

public void addLocalizedLists(String... lists)

addLocalizedLists

public void addLocalizedLists(ConnectionHandler connHandler,
                              String... lists)

addLists

public void addLists(String... lists)

addLists

public void addLists(ConnectionHandler connHandler,
                     String... lists)

addList

public void addList(ListData listData)
Adds the list to this ListManager, so there is no need to use ListManager.addList

Parameters:
listData -
Since:
1.11

setDateMaskForEverything

public void setDateMaskForEverything(String mask)
Set default mask for the whole application

Parameters:
mask -
Since:
1.12


Copyright © 2013. All Rights Reserved.