KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jfun > yan > monitoring > GetterMonitor


1 package jfun.yan.monitoring;
2
3 import java.beans.PropertyDescriptor JavaDoc;
4 /**
5  * <p>
6  * This interface represents something that monitors the invocation of a java bean getter.
7  * </p>
8  * @author Michelle Lei
9  *
10  */

11 public interface GetterMonitor {
12   /**
13    * This method is called right before the getter is called.
14    * @param obj the java bean object.
15    * @param desc the descriptor for the property.
16    */

17   void propertyGetting(Object JavaDoc obj, PropertyDescriptor JavaDoc desc);
18   /**
19    * This method is called after the getter is called successfully.
20    * @param obj the java bean object.
21    * @param desc the descriptor for the property.
22    * @param result the property value.
23    * @param duration exactly how long it took to run the getter. (in milliseconds)
24    */

25   void propertyGot(Object JavaDoc obj, PropertyDescriptor JavaDoc desc, Object JavaDoc result, long duration);
26   /**
27    * This method is called after the getter failed.
28    * @param obj the java bean object.
29    * @param desc the descriptor for the property.
30    * @param err the exception thrown out of the getter.
31    * @param duration exactly how long it took to run the getter. (in milliseconds)
32    */

33   void propertyGetFailed(Object JavaDoc obj, PropertyDescriptor JavaDoc desc,
34           Throwable JavaDoc err, long duration);
35 }
36
Popular Tags