org.mentawai.core
Class SingleInstanceActionConfig

java.lang.Object
  extended by org.mentawai.core.ActionConfig
      extended by org.mentawai.core.SingleInstanceActionConfig

public class SingleInstanceActionConfig
extends ActionConfig

Use this action config if you want your action to be a single instance for all requests, in other words, you don't want to create a new instance of your action for every request. If you use this action config, it is your responsibility to make your action thread-safe. If you are not sure that your action is thread-safe, than you should not use this action config. Sometimes our actions are so simple (Ex: org.mentawai.action.SuccessAction) that it doesn't make sense to create a new instance for every request. Although this is not a requirement, it is strongly recommended that you use SingleInstanceActionConfigs to configure SingleInstanceBaseActions.

Author:
Sergio Oliveira

Field Summary
 
Fields inherited from class org.mentawai.core.ActionConfig
actionClass
 
Constructor Summary
SingleInstanceActionConfig(Action instance)
           
SingleInstanceActionConfig(String name, Action instance)
           
SingleInstanceActionConfig(String name, Action instance, String innerAction)
           
 
Method Summary
 Action getAction()
          Returns an action instance to be used with this request.
 
Methods inherited from class org.mentawai.core.ActionConfig
addConsequence, addConsequence, addFilter, addFilter, addFilter, addFilter, addFilter, addFilterFirst, addFilterFirst, addFilterFirst, addFilterFirst, ajaxError, ajaxOk, all, authorize, authorize, bypassAuthentication, catchAll, chainError, chainOk, comeBackAfterLogin, fileUpload, fileUpload, fileUpload, fileUpload, fileUpload, filter, filter, filter, filter, filter, filterFirst, filterFirst, filterFirst, filterFirst, fwdError, fwdOk, getActionClass, getAutoConsequence, getCatchAll, getConsequence, getConsequence, getDirFromClass, getFilters, getFilters, getFirstFilters, getInnerAction, getName, internalOnly, isInternalOnly, methodParams, on, on, on, prettyURLParams, redirError, redirError, redirError, redirOk, redirOk, redirOk, shouldBypassAuthentication, shouldRedirectAfterLogin, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SingleInstanceActionConfig

public SingleInstanceActionConfig(Action instance)

SingleInstanceActionConfig

public SingleInstanceActionConfig(String name,
                                  Action instance)

SingleInstanceActionConfig

public SingleInstanceActionConfig(String name,
                                  Action instance,
                                  String innerAction)
Method Detail

getAction

public Action getAction()
Returns an action instance to be used with this request. This method will return the same instance for every call. It is your responsibility to make your action thread-safe.

Overrides:
getAction in class ActionConfig
Returns:
The action instance to use for the request.


Copyright © 2013. All Rights Reserved.