You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

ActionProxy acts as a representation proxy that is responsible for obtaining a particular Action and initiate its execution. This is such that one could have different means of getting an action. Its customizable through ActionProxyFactory. It should typically make uses of ActionInvocation which encapsulate the execution of a particular requiest.

ActionInvocation represents a particular action invocation and is customizable through ActionProxyFactory as well. It represents how an action is to be executed (eg. having it intercepted, then execute it, having PreResultListener acting on it before the Result is being executed etc).

In a nutshell, ActionProxy encapsulates how an Action can be obtained, while ActionInvocation encapsulates how the action is executed when a request is invoked.

Customization

ActionProxyFactory

 ActionProxyFactory.setFactory(new MyActionProxyFactory() {
    .....
 });

ActionProxy

 ActionProxyFactory.getFactory(new MyActionProxyFactory() {
    ....
    public ActionProxy createActionProxy(Configuration config, 
           String namespace, String actionName, Map extraContext) 
           throws Exception {
        createActionProxy(config, namespace, actionName, extraContext, true);
    }
    public ActionProxy createActionProxy(Configuration config, 
           String namespace, String actionName, Map extraContext, 
           boolean executeResult, boolean cleanupContext) 
           throws Exception {
        ....
   }
   ....
 });

ActionInvocation

 ActionProxyFactory.getFactory(new MyActionProxyFactory() {
    ...
    public ActionInvocation createActionInvocation(ActionProxy actionProxy) 
                            throws Exception {
          createActionInvocation(actionProxy, new LinkedHashMap());
    }
    public ActionInvocation createActionInvocation(ActionProxy actionProxy, 
                            Map extraContext) throws Exception {
          createActionInvocation(actionProxy, extraContext, true);
    }
    public ActionInvocation createActionInvocation(ActionProxy actionProxy, 
                            Map extraContext, boolean pushAction) 
                            throws Exception {
          // do implementation of ActionInvocation herer
          .....
    }
    ...
 });
  • No labels