1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.apache.fulcrum.yaafi.framework.interceptor;
26
27 import java.lang.reflect.Method;
28 import java.util.Map;
29
30 import org.apache.fulcrum.yaafi.framework.tls.ThreadLocalStorage;
31
32 /**
33 * Contains context information for the interceptors being invoked. The
34 * class contains a request context which allows to store data from within an
35 * interceptor. It also provides access to a ThreadLocalStorage to associate
36 * data with the current thread.
37 *
38 * @author <a href="mailto:siegfried.goeschl@it20one.at">Siegfried Goeschl</a>
39 */
40 public interface AvalonInterceptorContext
41 {
42 /**
43 * @return Returns the context for the given request.
44 */
45 Map getRequestContext();
46
47 /**
48 * @return Returns the serviceDelegate.
49 */
50 Object getServiceDelegate();
51
52 /**
53 * @return Returns the serviceName.
54 */
55 String getServiceName();
56
57 /**
58 * @return Returns the serviceShorthand.
59 */
60 String getServiceShorthand();
61
62 /**
63 * @return Returns the args.
64 */
65 Object [] getArgs();
66
67 /**
68 * @return Returns the method.
69 */
70 Method getMethod();
71
72 /**
73 * @return Returns the ThreadLocalStorage
74 */
75 ThreadLocalStorage getThreadContext();
76
77 /**
78 * @return is a transaction id defined for the current thread
79 */
80 boolean hasTransactionId();
81
82 /**
83 * @return get the transaction id defined for the current thread
84 */
85 Object getTransactionId();
86
87 /**
88 * Set the transaction id for the current thread.
89 * @param transactionId the transaction id
90 */
91 void setTransactionId(Object transactionId);
92
93 /**
94 * Clears the transaction id for the current thread.
95 */
96 void clearTransactionId();
97
98 /**
99 * Increment the current service invocation depth
100 */
101 void incrementInvocationDepth();
102
103 /**
104 * Decrement the current service invocation depth
105 */
106 void decrementInvocationDepth();
107
108 /**
109 * Get the current service invocation depth
110 * @return the current service invocation depth
111 */
112 int getInvocationDepth();
113
114 /**
115 * @return Returns the invocationId.
116 */
117 Long getInvocationId();
118 }