|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.profiling.profiler.Profiler<T>
public abstract class Profiler<T>
Base class for all profiling data handlers. A new instance is created for each method invocation
and the methods before and after/exception are called.
It stores invocation time and end time of the invocation.
Implementors of subclasses can provide methods annotated with ProfileMethod
. Depending on
the ProfileMethodType
the method has to have a specific signature:
ProfileMethod
annotation no method name is specified, the profile method will
be installed as default and called for all method invocations.
Field Summary | |
---|---|
protected static org.slf4j.Logger |
LOG
Logger. |
Constructor Summary | |
---|---|
Profiler(Class<? extends T> targetClass)
|
Method Summary | |
---|---|
void |
after(ProfilingData data,
String methodName,
Object returnValue)
This method is called after the invocation was successfully finished. |
void |
before(ProfilingData data,
Object target,
String methodName,
Object[] args)
This method is called before the invocation takes place on the given target object. |
void |
exception(ProfilingData data,
String methodName,
Exception exception)
This method is called after the invocation was successfully finished. |
Class<? extends T> |
getTargetClass()
|
void |
setProfilingDataManager(ProfilingDataManager dataManager)
|
void |
setProfilingIdGenerator(ProfilingIdGenerator idGenerator)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.slf4j.Logger LOG
Constructor Detail |
---|
public Profiler(Class<? extends T> targetClass)
targetClass
- class for which this profiler should be registeredMethod Detail |
---|
public final void after(ProfilingData data, String methodName, Object returnValue)
data
- the ProfilingData
object used to store the profiling information for this
invocation.methodName
- the name of the method that was intercepted.returnValue
- the return value of the method that was interceptedpublic final void before(ProfilingData data, Object target, String methodName, Object[] args)
data
- the ProfilingData
object used to store the profiling information for this
invocation.target
- the object on which the intercepted invocation is performed.methodName
- the name of the method that has been intercepted.args
- the arguments of the intercepted method.public final void exception(ProfilingData data, String methodName, Exception exception)
data
- the ProfilingData
object used to store the profiling information for this
invocation.methodName
- the name of the method that was intercepted.exception
- the exception that was thrown by the method that was interceptedpublic final Class<? extends T> getTargetClass()
Class
, whose instances will be profiled by this profiler.public void setProfilingDataManager(ProfilingDataManager dataManager)
public void setProfilingIdGenerator(ProfilingIdGenerator idGenerator)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |