KickJava   Java API By Example, From Geeks To Geeks.

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


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 setter.
7  * </p>
8  * @author Michelle Lei
9  *
10  */

11 public interface SetterMonitor {
12   /**
13    * This method is called right before the setter is called.
14    * @param obj the java bean object.
15    * @param desc the descriptor for the property.
16    * @param val the property value to set.
17    */

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

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

35   void propertySetFailed(Object JavaDoc obj, PropertyDescriptor JavaDoc desc, Object JavaDoc val,
36           Throwable JavaDoc err, long duration);
37 }
38
Popular Tags