org.apache.sirona.aop
Class AbstractPerformanceInterceptor<T>
java.lang.Object
org.apache.sirona.aop.AbstractPerformanceInterceptor<T>
- All Implemented Interfaces:
- Serializable
public abstract class AbstractPerformanceInterceptor<T>
- extends Object
- implements Serializable
A method interceptor that compute method invocation performances.
Concrete implementation will adapt the method interception API to
this class requirement.
- Author:
- Nicolas De Loof
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CONTEXTS
protected static final ConcurrentMap<Object,AbstractPerformanceInterceptor.ActivationContext> CONTEXTS
monitorNameExtractor
protected MonitorNameExtractor monitorNameExtractor
AbstractPerformanceInterceptor
public AbstractPerformanceInterceptor()
doInvoke
protected Object doInvoke(T invocation)
throws Throwable
- API neutral method invocation
- Throws:
Throwable
before
protected AbstractPerformanceInterceptor.Context before(T invocation,
String name)
newContext
protected AbstractPerformanceInterceptor.Context newContext(T invocation,
AbstractPerformanceInterceptor.ActivationContext context,
StopWatch stopwatch)
getKey
protected Counter.Key getKey(T invocation,
String name)
isAdaptive
protected boolean isAdaptive()
extractContextKey
protected Object extractContextKey(T invocation)
getOrCreateContext
protected AbstractPerformanceInterceptor.ActivationContext getOrCreateContext(Object m)
putAndGetActivationContext
protected AbstractPerformanceInterceptor.ActivationContext putAndGetActivationContext(Object m,
AbstractPerformanceInterceptor.ActivationContext newCtx)
doFindContext
protected AbstractPerformanceInterceptor.ActivationContext doFindContext(T invocation)
getRole
protected Role getRole()
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.