org.apache.commons.monitoring.aop
Class AbstractPerformanceInterceptor<T>

java.lang.Object
  extended by org.apache.commons.monitoring.aop.AbstractPerformanceInterceptor<T>
Direct Known Subclasses:
AopaliancePerformanceInterceptor, CommonsMonitoringAspect, CommonsMonitoringInterceptor

public abstract class AbstractPerformanceInterceptor<T>
extends Object

A method interceptor that compute method invocation performances.

Concrete implementation will adapt the method interception API to this class requirement.

Author:
Nicolas De Loof

Field Summary
protected  MonitorNameExtractor monitorNameExtractor
           
 
Constructor Summary
AbstractPerformanceInterceptor()
           
 
Method Summary
protected  Object doInvoke(T invocation)
          API neutral method invocation
protected  String getCounterName(Object instance, Method method)
          Compute the counter name associated to this method invocation
protected abstract  String getCounterName(T invocation)
           
protected abstract  Object proceed(T invocation)
           
 void setMonitorNameExtractor(MonitorNameExtractor monitorNameExtractor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

monitorNameExtractor

protected MonitorNameExtractor monitorNameExtractor
Constructor Detail

AbstractPerformanceInterceptor

public AbstractPerformanceInterceptor()
Method Detail

doInvoke

protected Object doInvoke(T invocation)
                   throws Throwable
API neutral method invocation

Throws:
Throwable

proceed

protected abstract Object proceed(T invocation)
                           throws Throwable
Throws:
Throwable

getCounterName

protected abstract String getCounterName(T invocation)

getCounterName

protected String getCounterName(Object instance,
                                Method method)
Compute the counter name associated to this method invocation

Parameters:
method - method being invoked
Returns:
counter name. If null, nothing will be monitored

setMonitorNameExtractor

public void setMonitorNameExtractor(MonitorNameExtractor monitorNameExtractor)


Copyright © 2008–2013 The Apache Software Foundation. All rights reserved.