org.apache.commons.monitoring.aop
Class AbstractPerformanceInterceptor<T>
java.lang.Object
org.apache.commons.monitoring.aop.AbstractPerformanceInterceptor<T>
- Direct Known Subclasses:
- AopPerformanceInterceptor, CommonsProxyPerformanceInterceptor
public abstract class AbstractPerformanceInterceptor<T>
- extends java.lang.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
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
repository
protected Repository repository
category
protected java.lang.String category
subsystem
protected java.lang.String subsystem
monitorNameExtractor
protected MonitorNameExtractor monitorNameExtractor
AbstractPerformanceInterceptor
public AbstractPerformanceInterceptor()
doInvoke
protected java.lang.Object doInvoke(T invocation)
throws java.lang.Throwable
- API neutral method invocation
- Throws:
java.lang.Throwable
proceed
protected abstract java.lang.Object proceed(T invocation)
throws java.lang.Throwable
- Parameters:
invocation -
- Returns:
-
- Throws:
java.lang.Throwable
getMonitorName
protected abstract java.lang.String getMonitorName(T invocation)
- Parameters:
invocation -
- Returns:
getMonitorName
protected java.lang.String getMonitorName(java.lang.reflect.Method method)
- Compute the monitor name associated to this method invocation
- Parameters:
method - method being invoked
- Returns:
- monitor name. If
null, nothing will be monitored
beforeReturning
protected void beforeReturning(Monitor monitor,
java.lang.Throwable error,
long duration)
- Parameters:
monitor - the monitor associated to the method invocationerror - Throwable thrown by the method invocation if anyduration - the duration of the method invocation
setRepository
public void setRepository(Repository repository)
- Set a custom application-defined repository
- Parameters:
repository -
setCategory
public void setCategory(java.lang.String category)
setSubsystem
public void setSubsystem(java.lang.String subsystem)
setMonitorNameExtractor
public void setMonitorNameExtractor(MonitorNameExtractor monitorNameExtractor)
- Parameters:
monitorNameExtractor - the monitorNameExtractor to set
Copyright © 2008 The Apache Software Foundation. All Rights Reserved.