org.javasimon.spring
Class MonitoringInterceptor

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

public class MonitoringInterceptor
extends BasicMonitoringInterceptor

Method interceptor that measures the duration of the intercepted call with a Stopwatch and treats failure cases (exceptions) separately. By default exceptional flow reports to "stopwatch.failed" (EXCEPTION_TAG), but setting

Author:
Richard "Virgo" Richter
See Also:
Serialized Form

Field Summary
static String EXCEPTION_TAG
           
private  boolean tagByExceptionType
           
 
Constructor Summary
MonitoringInterceptor()
          Default constructor using SimonManager.manager.
MonitoringInterceptor(Manager manager)
          Constructor with specified Manager.
MonitoringInterceptor(StopwatchSource<org.aopalliance.intercept.MethodInvocation> stopwatchSource)
          Constructor with specified MonitorSource.
 
Method Summary
protected  Object processInvoke(org.aopalliance.intercept.MethodInvocation invocation, Split split)
          Method stops the split
 void setTagByExceptionType(boolean tagByExceptionType)
          Sets whether all exceptions should report to EXCEPTION_TAG sub-simon or sub-simon for each exception type should be introduced (based on exception's simple name).
 
Methods inherited from class org.javasimon.spring.BasicMonitoringInterceptor
invoke
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EXCEPTION_TAG

public static final String EXCEPTION_TAG
See Also:
Constant Field Values

tagByExceptionType

private boolean tagByExceptionType
Constructor Detail

MonitoringInterceptor

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

Parameters:
stopwatchSource - stopwatch provider for method invocation

MonitoringInterceptor

public MonitoringInterceptor(Manager manager)
Constructor with specified Manager.


MonitoringInterceptor

public MonitoringInterceptor()
Default constructor using SimonManager.manager.

Method Detail

setTagByExceptionType

public void setTagByExceptionType(boolean tagByExceptionType)
Sets whether all exceptions should report to EXCEPTION_TAG sub-simon or sub-simon for each exception type should be introduced (based on exception's simple name).

Parameters:
tagByExceptionType - true for fine grained exception-class-name-based sub-simons

processInvoke

protected Object processInvoke(org.aopalliance.intercept.MethodInvocation invocation,
                               Split split)
                        throws Throwable
Method stops the split

Overrides:
processInvoke in class BasicMonitoringInterceptor
Parameters:
invocation - method invocation
split - running split for this monitored action
Returns:
return object from the method
Throws:
Throwable


Copyright © 2013. All Rights Reserved.