jodd.madvoc
Class ActionRequest

java.lang.Object
  extended by jodd.madvoc.ActionRequest

public class ActionRequest
extends java.lang.Object

Encapsulates single action invocation and acts as an action proxy. It invokes all assigned action interceptors during action invocation and specifies the result after action method invocation.


Field Summary
protected  java.lang.Object action
           
protected  ActionConfig config
           
protected  boolean executed
           
protected  int interceptorIndex
           
protected  java.lang.String nextActionPath
           
protected  java.lang.Object[] params
           
protected  ActionRequest previousActionRequest
           
protected  javax.servlet.http.HttpServletRequest serlvetRequest
           
protected  javax.servlet.http.HttpServletResponse servletResponse
           
protected  int totalInterceptors
           
 
Constructor Summary
ActionRequest(ActionConfig config, java.lang.Object action, javax.servlet.http.HttpServletRequest serlvetRequest, javax.servlet.http.HttpServletResponse servletResponse)
          Creates new action request and action object.
 
Method Summary
 java.lang.Object getAction()
          Returns action object.
 ActionConfig getActionConfig()
          Returns action configuration.
 java.lang.String getActionPath()
          Returns action path.
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
          Returns servlet request.
 javax.servlet.http.HttpServletResponse getHttpServletResponse()
          Returns servlet response.
 java.lang.String getNextActionPath()
          Returns next request string for action chaining.
 ActionRequest getPreviousActionRequest()
          Returns previous action request in chain, if there was one.
 java.lang.Object invoke()
          Invokes the action and returns action result value object.
protected  java.lang.Object invokeAction()
          Invokes action method after starting all interceptors.
 boolean isExecuted()
          Returns true if action request was already executed.
 void setActionParams(java.lang.Object[] params)
          Sets values for action method parameters.
 void setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
          Specifies new servlet request, in case of wrapping it.
 void setHttpServletResponse(javax.servlet.http.HttpServletResponse response)
          Specifies new servlet response, in case of wrapping it.
 void setNextActionPath(java.lang.String nextActionPath)
          Specifies the next action path, that will be chained to current action request.
 void setPreviousActionRequest(ActionRequest previousActionRequest)
          Sets previous action request in chain.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected final ActionConfig config

serlvetRequest

protected javax.servlet.http.HttpServletRequest serlvetRequest

servletResponse

protected javax.servlet.http.HttpServletResponse servletResponse

params

protected java.lang.Object[] params

totalInterceptors

protected final int totalInterceptors

interceptorIndex

protected int interceptorIndex

action

protected java.lang.Object action

executed

protected boolean executed

nextActionPath

protected java.lang.String nextActionPath

previousActionRequest

protected ActionRequest previousActionRequest
Constructor Detail

ActionRequest

public ActionRequest(ActionConfig config,
                     java.lang.Object action,
                     javax.servlet.http.HttpServletRequest serlvetRequest,
                     javax.servlet.http.HttpServletResponse servletResponse)
Creates new action request and action object.

Method Detail

getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()
Returns servlet request.


setHttpServletRequest

public void setHttpServletRequest(javax.servlet.http.HttpServletRequest request)
Specifies new servlet request, in case of wrapping it.


getHttpServletResponse

public javax.servlet.http.HttpServletResponse getHttpServletResponse()
Returns servlet response.


setHttpServletResponse

public void setHttpServletResponse(javax.servlet.http.HttpServletResponse response)
Specifies new servlet response, in case of wrapping it.


getActionConfig

public ActionConfig getActionConfig()
Returns action configuration.


getAction

public java.lang.Object getAction()
Returns action object.


getActionPath

public java.lang.String getActionPath()
Returns action path.


isExecuted

public boolean isExecuted()
Returns true if action request was already executed.


getNextActionPath

public java.lang.String getNextActionPath()
Returns next request string for action chaining.


setNextActionPath

public void setNextActionPath(java.lang.String nextActionPath)
Specifies the next action path, that will be chained to current action request.


getPreviousActionRequest

public ActionRequest getPreviousActionRequest()
Returns previous action request in chain, if there was one.


setPreviousActionRequest

public void setPreviousActionRequest(ActionRequest previousActionRequest)
Sets previous action request in chain.


setActionParams

public void setActionParams(java.lang.Object[] params)
Sets values for action method parameters.


invoke

public java.lang.Object invoke()
                        throws java.lang.Exception
Invokes the action and returns action result value object. Invokes all interceptors before and after action invocation.

Throws:
java.lang.Exception

invokeAction

protected java.lang.Object invokeAction()
                                 throws java.lang.Exception
Invokes action method after starting all interceptors. After method invocation, all interceptors will finish, in opposite order.

Throws:
java.lang.Exception


Copyright © 2003-2010 Jodd Team