Clover coverage report - CRISPY - 1.1.1
Coverage timestamp: Mi Nov 15 2006 13:09:46 CET
file stats: LOC: 67   Methods: 10
NCLOC: 28   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
StopWatchInterceptor.java - 100% 100% 100%
coverage
 1    /*
 2    * Created on 09.05.2005 from Linke
 3    *
 4    */
 5    package net.sf.crispy.interceptor;
 6   
 7    import net.sf.crispy.Interceptor;
 8    import net.sf.crispy.InterceptorContext;
 9   
 10    /**
 11    * Mini stopwatch.
 12    *
 13    * @author Linke
 14    *
 15    */
 16    public class StopWatchInterceptor implements Interceptor {
 17   
 18    private long startTimeNewInstance = 0;
 19    private long endTimeNewInstance = -1;
 20    private long startTimeInvokeMethod = 0;
 21    private long endTimeInvokeMethod = -1;
 22   
 23    private int onErrorCounter = 0;
 24   
 25    /**
 26    * @see net.sf.crispy.Interceptor#beforeNewInstance(java.lang.Class)
 27    */
 28  117 public void beforeNewInstance(Class pvInterfaceClass) {
 29  117 startTimeNewInstance = System.currentTimeMillis();
 30    }
 31   
 32    /**
 33    * @see net.sf.crispy.Interceptor#afterNewInstance(java.lang.Class, java.lang.Object)
 34    */
 35  117 public void afterNewInstance(Class pvInterfaceClass, Object pvProxyObject) {
 36  117 endTimeNewInstance = System.currentTimeMillis() - startTimeNewInstance;
 37    }
 38   
 39   
 40   
 41    /**
 42    * @see net.sf.crispy.Interceptor#beforeMethodInvocation(net.sf.crispy.InterceptorContext)
 43    */
 44  152 public void beforeMethodInvocation(InterceptorContext pvInterceptorContext) {
 45  152 startTimeInvokeMethod = System.currentTimeMillis();
 46    }
 47   
 48    /**
 49    * @see net.sf.crispy.Interceptor#afterMethodInvocation(net.sf.crispy.InterceptorContext)
 50    */
 51  152 public void afterMethodInvocation(InterceptorContext pvInterceptorContext) {
 52  152 endTimeInvokeMethod = System.currentTimeMillis() - startTimeInvokeMethod;
 53    }
 54   
 55    /**
 56    * @see net.sf.crispy.Interceptor#onError(java.lang.Throwable)
 57    */
 58  4 public void onError(Throwable pvThrowable) { ++onErrorCounter; }
 59   
 60  17 public long getStopTimeNewInstance() { return endTimeNewInstance; }
 61  60 public long getStopTimeInvokeMethod() { return endTimeInvokeMethod; }
 62   
 63  2 public int getOnErrorCounter() { return onErrorCounter; }
 64   
 65  6 public void clearStopTimeInvokeMethod() { endTimeInvokeMethod = 0; }
 66  1 public void clearStopTimeNewInstance() { endTimeNewInstance = 0; }
 67    }