org.mentawai.core
Class InvocationChain

java.lang.Object
  extended by org.mentawai.core.InvocationChain

public class InvocationChain
extends Object

When an action is executed, a chain of filters is created. The last step of any InvocationChain is the action. An action may have one or more filters and global filters.

Author:
Sergio Oliveira

Constructor Summary
InvocationChain(String actionName, Action action, ActionConfig ac)
          Creates an InvocationChain for this action.
 
Method Summary
 Action getAction()
          Gets the action of this InvocationChain
 ActionConfig getActionConfig()
           
 String getActionName()
          Returns the name of the action being executed in the invocation chain.
 Filter getFilter(Class<? extends Filter> filterClass)
           
 List<Filter> getFilters()
          Returns the filters of this invocation chain.
 String getInnerAction()
          Returns the inner action being executed in the invocation chain.
 Object getPojo()
          Check whether this action is a PojoAction to return its pojo.
protected  void initInnerAction(Action mainAction, Action innerAction)
          Initialize inner action class contexts with the main action contexts...
 String invoke()
          Invoke and execute the next step in this InvocationChain.
 void setInnerAction(String innerAction)
          Sets an inner action to be executed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InvocationChain

public InvocationChain(String actionName,
                       Action action,
                       ActionConfig ac)
Creates an InvocationChain for this action.

Parameters:
action - The action for what this InvocationChain will be created.
Method Detail

getActionConfig

public ActionConfig getActionConfig()

getFilter

public Filter getFilter(Class<? extends Filter> filterClass)

getAction

public Action getAction()
Gets the action of this InvocationChain

Returns:
The action of this InvocationChain

getPojo

public Object getPojo()
Check whether this action is a PojoAction to return its pojo.

Returns:
the Pojo or null if not pojo action
Since:
1.10

invoke

public String invoke()
              throws Exception
Invoke and execute the next step in this InvocationChain. This can be the next filter or the action.

Returns:
The result of a filter or the action.
Throws:
Exception

initInnerAction

protected void initInnerAction(Action mainAction,
                               Action innerAction)
Initialize inner action class contexts with the main action contexts...

Parameters:
mainAction - The main action.
innerAction - The inner action object. (inner class)
Since:
1.9

setInnerAction

public void setInnerAction(String innerAction)
Sets an inner action to be executed. An inner action is a method inside the action implementation that can be executed instead of the execute() method.

Parameters:
innerAction - The name of the method to be executed as an inner action

getInnerAction

public String getInnerAction()
Returns the inner action being executed in the invocation chain.

Returns:
The innner action or null if there is no inner action being executed.
Since:
1.2.1

getActionName

public String getActionName()
Returns the name of the action being executed in the invocation chain.

Returns:
The action name like HelloMentawai
Since:
1.8

getFilters

public List<Filter> getFilters()
Returns the filters of this invocation chain.

Returns:
all filters of this invocation chain
Since:
1.4


Copyright © 2013. All Rights Reserved.