org.javasimon.spring
Class MonitoringInterceptor

java.lang.Object
  extended by org.javasimon.spring.MonitoringInterceptor
All Implemented Interfaces:
Serializable, org.aopalliance.aop.Advice, org.aopalliance.intercept.Interceptor, org.aopalliance.intercept.MethodInterceptor

public final class MonitoringInterceptor
extends Object
implements org.aopalliance.intercept.MethodInterceptor, Serializable

Method interceptor that measures the duration of the intercepted call with a Stopwatch.

Author:
Erik van Oosten
See Also:
Serialized Form

Field Summary
private  StopwatchTemplate<org.aopalliance.intercept.MethodInvocation> stopwatchTemplate
          Stopwatch template.
 
Constructor Summary
MonitoringInterceptor()
          Default constuctor using SimonManager.manager.
MonitoringInterceptor(Manager manager)
          Constuctor with specified Manager.
MonitoringInterceptor(MonitorSource<org.aopalliance.intercept.MethodInvocation,Stopwatch> stopwatchSource)
          Constructor with specified MonitorSource.
 
Method Summary
 Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
          Performs method invocation and wraps it with Stopwatch.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stopwatchTemplate

private final StopwatchTemplate<org.aopalliance.intercept.MethodInvocation> stopwatchTemplate
Stopwatch template.

Constructor Detail

MonitoringInterceptor

public MonitoringInterceptor(MonitorSource<org.aopalliance.intercept.MethodInvocation,Stopwatch> stopwatchSource)
Constructor with specified MonitorSource.

Parameters:
stopwatchSource - stopwtach provider for method invocation

MonitoringInterceptor

public MonitoringInterceptor(Manager manager)
Constuctor with specified Manager.


MonitoringInterceptor

public MonitoringInterceptor()
Default constuctor using SimonManager.manager.

Method Detail

invoke

public Object invoke(org.aopalliance.intercept.MethodInvocation invocation)
              throws Throwable
Performs method invocation and wraps it with Stopwatch.

Specified by:
invoke in interface org.aopalliance.intercept.MethodInterceptor
Parameters:
invocation - method invocation
Returns:
return object from the method
Throws:
Throwable - anything thrown by the method


Copyright © 2012. All Rights Reserved.