jfun.yan.monitoring
Interface CtorMonitor

All Known Subinterfaces:
ComponentMonitor
All Known Implementing Classes:
NopComponentMonitor

public interface CtorMonitor

This interface represents something that monitors the invocation of a constructor.

Author:
Michelle Lei

Method Summary
 void constructed(java.lang.reflect.Constructor ctor, java.lang.Object[] args, java.lang.Object instance, long duration)
          This method is called right after the constructor is invoked successfully.
 void constructing(java.lang.reflect.Constructor ctor, java.lang.Object[] args)
          This method is called right before the constructor is invoked.
 void constructionFailed(java.lang.reflect.Constructor ctor, java.lang.Object[] args, java.lang.Throwable e, long duration)
          This method is called after the constructor failed.
 

Method Detail

constructing

void constructing(java.lang.reflect.Constructor ctor,
                  java.lang.Object[] args)
This method is called right before the constructor is invoked.

Parameters:
ctor - the constructor to be called.
args - the arguments passed to the constructor.

constructed

void constructed(java.lang.reflect.Constructor ctor,
                 java.lang.Object[] args,
                 java.lang.Object instance,
                 long duration)
This method is called right after the constructor is invoked successfully.

Parameters:
ctor - the constructor.
args - the arguments passed to the constructor.
instance - the object created by the constructor.
duration - excactly how long the constructor execution takes. (in milliseconds)

constructionFailed

void constructionFailed(java.lang.reflect.Constructor ctor,
                        java.lang.Object[] args,
                        java.lang.Throwable e,
                        long duration)
This method is called after the constructor failed.

Parameters:
ctor - the constructor.
args - the arguments passed to the constructor.
e - the exception thrown out of the constructor.
duration - exactly how long the constructor execution takes. (in milliseconds)