KickJava   Java API By Example, From Geeks To Geeks.

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


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

12 public interface CtorMonitor {
13   /**
14    * This method is called right before the constructor is invoked.
15    * @param ctor the constructor to be called.
16    * @param args the arguments passed to the constructor.
17    */

18   void constructing(Constructor JavaDoc ctor, Object JavaDoc[] args);
19   /**
20    * This method is called right after the constructor is invoked successfully.
21    * @param ctor the constructor.
22    * @param args the arguments passed to the constructor.
23    * @param instance the object created by the constructor.
24    * @param duration excactly how long the constructor execution takes. (in milliseconds)
25    */

26   void constructed(Constructor JavaDoc ctor, Object JavaDoc[] args, Object JavaDoc instance, long duration);
27   /**
28    * This method is called after the constructor failed.
29    * @param ctor the constructor.
30    * @param args the arguments passed to the constructor.
31    * @param e the exception thrown out of the constructor.
32    * @param duration exactly how long the constructor execution takes. (in milliseconds)
33    */

34   void constructionFailed(Constructor JavaDoc ctor, Object JavaDoc[] args, Throwable JavaDoc e, long duration);
35 }
36
Popular Tags