net.sf.sensor.support.spring
Class MethodTimingInterceptor

java.lang.Object
  extended bynet.sf.sensor.support.spring.MethodTimingInterceptor
All Implemented Interfaces:
org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public class MethodTimingInterceptor
extends Object
implements org.aopalliance.intercept.MethodInterceptor

Spring method interceptor that wraps a method call in a Sensor Timer using the dependency injected TimerRuntime.

Method signature util methods copied from the extended JamonIntercepter as blogged by Gerald Loeffler.

Author:
Age Mooy

Constructor Summary
MethodTimingInterceptor()
           
 
Method Summary
 Object invoke(org.aopalliance.intercept.MethodInvocation mi)
          Wraps the intercepted method call in a Timer using the method signature as the Timer label.
 void setAssociatedLabels(Set associatedLabels)
          Sets the associatedLabels.
 void setTimerRuntime(net.sf.sensor.timer.TimerRuntime timerRuntime)
          Sets the timerRuntime.
 void setUseParamTypesInId(boolean useParamTypesInId)
          Sets the property that controls whether the generated Timer label will contain the method parameter types or not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodTimingInterceptor

public MethodTimingInterceptor()
Method Detail

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation mi)
              throws Throwable
Wraps the intercepted method call in a Timer using the method signature as the Timer label. If there is no TimerRuntime available, this method proceeds with the intercepted method without doing anything else.

Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Throws:
Throwable
See Also:
MethodInterceptor.invoke(org.aopalliance.intercept.MethodInvocation)

setTimerRuntime

public void setTimerRuntime(net.sf.sensor.timer.TimerRuntime timerRuntime)
Sets the timerRuntime.

Parameters:
timerRuntime - The timerRuntime to set.

setAssociatedLabels

public void setAssociatedLabels(Set associatedLabels)
Sets the associatedLabels.

Parameters:
associatedLabels - The associatedLabels to set.

setUseParamTypesInId

public void setUseParamTypesInId(boolean useParamTypesInId)
Sets the property that controls whether the generated Timer label will contain the method parameter types or not. Defaults to true.

Parameters:
useParamTypesInId - The useParamTypesInId to set.


Copyright © 2005-2006 SourceForge. All Rights Reserved.