KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > dynaop > example > SetIdInterceptor


1 package dynaop.example;
2
3 import dynaop.DispatchInterceptor;
4
5 /**
6  * Intercepts invocations on setId(long). Prints message when ID changes.
7  *
8  * @author Bob Lee (crazybob@crazybob.org)
9  */

10 public class SetIdInterceptor extends DispatchInterceptor {
11
12     public void setId(long id) throws Throwable JavaDoc {
13         System.out.println("=> Changing ID to " + id + "...");
14         proceed();
15         System.out.println("=> ID changed.");
16     }
17 }
18
Popular Tags