01: package dynaop.example;
02:
03: import dynaop.Interceptor;
04: import dynaop.Invocation;
05:
06: /**
07: * Adds method invocation to sequence diagram.
08: *
09: * @author Bob Lee (crazybob@crazybob.org)
10: */
11: public class SequenceInterceptor implements Interceptor {
12:
13: public Object intercept(Invocation i) throws Throwable {
14: try {
15: Sequence.start(i.getProxy(), i.getProxy().getProxyContext()
16: .unwrap(), i.getMethod().getName());
17: return i.proceed();
18: } finally {
19: Sequence.end();
20: }
21: }
22:
23: }
|