KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > ExampleCrosscut


1
2
3 import ch.ethz.prose.*;
4 import ch.ethz.prose.crosscut.*;
5 import ch.ethz.prose.filter.*;
6
7 public class ExampleCrosscut extends MethodCut
8 {
9   // trap Foo.*(..)
10
public void METHOD_ARGS(Foo x, String JavaDoc arg1,REST y)
11     {
12       System.err.println(" ->advice: before "+ x + ".'bar*'("+ arg1 +",..) called");
13     }
14
15   // .. && calls(* bar(..))
16
protected PointCutter pointCutter()
17     { return (Executions.before() . AND (Within.method("bar.*")) );}
18 }
19
Popular Tags