01: /*
02: * Copyright (c) 2002-2006 by OpenSymphony
03: * All rights reserved.
04: */
05: package com.opensymphony.xwork;
06:
07: import com.opensymphony.xwork.config.entities.ActionConfig;
08:
09: /**
10: * ActionProxy is an extra layer between XWork and the action so that different proxies are possible.
11: * <p/>
12: * An example of this would be a remote proxy, where the layer between XWork and the action might be RMI or SOAP.
13: *
14: * @author Jason Carreira
15: * Created Jun 9, 2003 11:27:55 AM
16: */
17: public interface ActionProxy {
18:
19: /**
20: * @return the Action instance for this Proxy
21: */
22: Object getAction();
23:
24: /**
25: * @return the alias name this ActionProxy is mapped to
26: */
27: String getActionName();
28:
29: /**
30: * @return the ActionConfig this ActionProxy is built from
31: */
32: ActionConfig getConfig();
33:
34: /**
35: * Sets whether this ActionProxy should also execute the Result after executing the Action
36: *
37: * @param executeResult
38: */
39: void setExecuteResult(boolean executeResult);
40:
41: /**
42: * @return the status of whether the ActionProxy is set to execute the Result after the Action is executed
43: */
44: boolean getExecuteResult();
45:
46: /**
47: * @return the ActionInvocation associated with this ActionProxy
48: */
49: ActionInvocation getInvocation();
50:
51: /**
52: * @return the namespace the ActionConfig for this ActionProxy is mapped to
53: */
54: String getNamespace();
55:
56: /**
57: * Execute this ActionProxy. This will set the ActionContext from the ActionInvocation into the ActionContext
58: * ThreadLocal before invoking the ActionInvocation, then set the old ActionContext back into the ThreadLocal.
59: *
60: * @return the result code returned from executing the ActionInvocation
61: * @throws Exception
62: * @see ActionInvocation
63: */
64: String execute() throws Exception;
65:
66: /**
67: * Sets the method to execute for the action invocation. If no method is specified, the method provided by
68: * in the action's configuration will be used.
69: *
70: * @param method the string name of the method to invoke
71: */
72: void setMethod(String method);
73:
74: /**
75: * Returns the method to execute, or null if no method has been specified (meaning "execute" will be invoked)
76: */
77: String getMethod();
78: }
|