01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.aspectwerkz.joinpoint;
05:
06: import com.tc.aspectwerkz.joinpoint.management.JoinPointType;
07:
08: /**
09: * Implements the join point concept, e.g. defines a well defined point in the program flow.
10: * <p/>
11: * Provides access to only static data, is therefore much more performant than the usage of the {@link
12: * com.tc.aspectwerkz.joinpoint.JoinPoint} interface.
13: * <p/>
14: * Note that it is possible to call proceed() on a StaticJoinPoint instance. The optimization comes from the fact
15: * that StaticJoinPoint does not host RTTI information (caller, callee instances and args). It can be used with
16: * pcd "args()", "this()" and "target()".
17: *
18: * @author <a href="mailto:jboner@codehaus.org">Jonas BonŽr </a>
19: */
20: public interface StaticJoinPoint {
21: public static final String METHOD_EXECUTION = "METHOD_EXECUTION";
22: public static final String METHOD_CALL = "METHOD_CALL";
23: public static final String CONSTRUCTOR_EXECUTION = "CONSTRUCTOR_EXECUTION";
24: public static final String CONSTRUCTOR_CALL = "CONSTRUCTOR_CALL";
25: public static final String FIELD_SET = "FIELD_SET";
26: public static final String FIELD_GET = "FIELD_GET";
27: public static final String HANDLER = "HANDLER";
28: public static final String STATIC_INITIALIZATION = "STATIC_INITIALIZATION";
29:
30: /**
31: * Walks through the pointcuts and invokes all its advices. When the last advice of the last pointcut has been
32: * invoked, the original method is invoked. Is called recursively.
33: *
34: * @return the result from the next invocation
35: * @throws Throwable
36: */
37: Object proceed() throws Throwable;
38:
39: /**
40: * Returns metadata matchingn a specfic key.
41: *
42: * @param key the key to the metadata
43: * @return the value
44: */
45: Object getMetaData(Object key);
46:
47: /**
48: * Adds metadata.
49: *
50: * @param key the key to the metadata
51: * @param value the value
52: */
53: void addMetaData(Object key, Object value);
54:
55: /**
56: * Returns the signature for the join point.
57: *
58: * @return the signature
59: */
60: Signature getSignature();
61:
62: /**
63: * Returns the caller class.
64: *
65: * @return the caller class
66: */
67: Class getCallerClass();
68:
69: /**
70: * Returns the callee class.
71: *
72: * @return the target class
73: */
74: Class getCalleeClass();
75:
76: /**
77: * Returns the callee class.
78: *
79: * @return the target class
80: * @deprecated use getCalleeClass() instead
81: */
82: Class getTargetClass();
83:
84: /**
85: * Returns the join point type.
86: *
87: * @return the type
88: */
89: JoinPointType getType();
90:
91: /**
92: * Returns the enclosing static joinpoint.
93: *
94: * @return the enclosing static joinpoint
95: */
96: EnclosingStaticJoinPoint getEnclosingStaticJoinPoint();
97: }
|