The ActionProxy obtains the Action class and calls the appropriate method. By default, Actions are obtained through local instantiation, but an Action could also be obtained remotely if an alternative ActionProxy were provided.
An alternative ActionProxy can be configured through ActionProxyFactory. Typically, an ActionProxy will utilize the ActionInvocation to 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 requiestrequest.
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).
The ActionInvocation determines how an Action is handled: Is it being intercepted? Is there a PreResultListener acting on it?
EssentiallyIn a nutshell, ActionProxy encapsulates how an Action can be obtained, while . ActionInvocation encapsulates how the action Action is executed when a request is invoked.
...
Code Block |
---|
ActionProxyFactory.setFactory(new MyActionProxyFactory() { // Do something interesting..... }); |
ActionProxy
Code Block |
---|
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 { .... } .... }); |
...
Code Block |
---|
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 { // doDo implementation of ActionInvocation hererhere ..... } ... }); |