01: // $Id: ExampleAspect.java,v 1.1.1.1 2003/07/02 15:30:42 apopovic Exp $
02: // =====================================================================
03: //
04: // (history at end)
05: //
06:
07: package local;
08:
09: // used packages
10: import ch.ethz.prose.DefaultAspect;
11: import ch.ethz.prose.crosscut.Crosscut;
12: import ch.ethz.prose.crosscut.MethodCut;
13: import ch.ethz.prose.crosscut.REST;
14: import ch.ethz.prose.filter.PointCutter;
15: import ch.ethz.prose.filter.Executions;
16: import ch.ethz.prose.filter.Within;
17: import ch.ethz.prose.crosscut.MissingInformationException;
18:
19: /**
20: * Class ExampleAspect
21: *
22: * @version $Revision: 1.1.1.1 $
23: * @author Andrei Popovici
24: */
25: public class ExampleAspect extends DefaultAspect {
26:
27: public Crosscut c1 = new MethodCut() {
28: // trap Foo.*(..)
29: public void METHOD_ARGS(Foo x, String arg1, REST y) {
30: System.err.println(" ->advice: before " + x
31: + ".'bar*'(" + arg1 + ",..) called");
32: }
33:
34: // .. && calls(* bar(..))
35: protected PointCutter pointCutter() {
36: return (Executions.before().AND(Within.method("bar.*")));
37: }
38: };
39: }
40:
41: //======================================================================
42: //
43: // $Log: ExampleAspect.java,v $
44: // Revision 1.1.1.1 2003/07/02 15:30:42 apopovic
45: // Imported from ETH Zurich
46: //
47: // Revision 1.4 2003/05/14 08:43:18 andfrei
48: // changed local example to package local
49: //
50: // Revision 1.3 2003/05/05 14:02:47 popovici
51: // renaming from runes to prose
52: //
53: // Revision 1.2 2003/04/27 13:08:56 popovici
54: // Specializers renamed to PointCutter
55: //
56: // Revision 1.1 2003/04/22 16:26:49 andfrei
57: // added a local test aspect
58: //
59: // Revision 1.5 2003/03/13 14:20:25 popovici
60: // Tools and modifications for a demo with remote clients
61: //
62: // Revision 1.4 2003/03/05 12:08:40 popovici
63: // Deobfuscation of exception filters. They are now
64: // top level classes. This is just an intermediate refactoring
65: // step. Many ExceptionS. predicate will be eliminated
66: // by more powerful Specializers like 'ExecutionS'
67: //
68: // Revision 1.3 2002/06/07 07:40:23 popovici
69: // Adapted to the ClasseS/DeclarationS, MethodCut, etc.. refactorization
70: //
71: // Revision 1.1 2002/03/27 13:56:39 popovici
72: // Legal and realease changes:
73: // added LEGAL & licenses
74: // added profiles/release
75: // added programs/* scripts for installation
76: // modified project/* files for installation
77: //
|