|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.perf4j.aop.AgnosticTimingAspect
public class AgnosticTimingAspect
This AgnosticTimingAspect class contains all the logic for executing a profiled method with appropriate timing calls,
but in an AOP-framework-agnostic way. You may choose to either extend or wrap this class to create an aspect in
your desired framework. For example, if you look at the AbstractTimingAspect
, you can see
that it delegates all functionality to this class - it just includes the necessary AspectJ annotations and wraps
the AspectJ-specific ProceedingJoinPoint as an AbstractJoinPoint
.
Constructor Summary | |
---|---|
AgnosticTimingAspect()
|
Method Summary | |
---|---|
protected String |
evaluateJexl(String text,
Object[] args,
Object annotatedObject,
Object returnValue,
Throwable exceptionThrown)
Helper method is used to parse out {expressionLanguage} elements from the text and evaluate the strings using JEXL. |
protected org.apache.commons.jexl.Expression |
getJexlExpression(String expressionText)
Helper method gets a compiled JEXL expression for the specified expression text, either from the cache or by creating a new compiled expression. |
protected String |
getStopWatchMessage(Profiled profiled,
AbstractJoinPoint joinPoint,
Object returnValue,
Throwable exceptionThrown)
Helper method get the message to use for StopWatch logging. |
protected String |
getStopWatchTag(Profiled profiled,
AbstractJoinPoint joinPoint,
Object returnValue,
Throwable exceptionThrown)
Helper method gets the tag to use for StopWatch logging. |
Object |
runProfiledMethod(AbstractJoinPoint joinPoint,
Profiled profiled,
LoggingStopWatch stopWatch)
This method actually executes the profiled method. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AgnosticTimingAspect()
Method Detail |
---|
public Object runProfiledMethod(AbstractJoinPoint joinPoint, Profiled profiled, LoggingStopWatch stopWatch) throws Throwable
joinPoint
- The AOP join point - usually this will just be a simple wrapper around the
AOP-framework-specific join point.profiled
- The Profiled annotation that was set on the method being profiled.stopWatch
- This LogginStopWatch should be started JUST before this method is called.
Throwable
- Exception thrown by the profiled method will bubble up.protected String getStopWatchTag(Profiled profiled, AbstractJoinPoint joinPoint, Object returnValue, Throwable exceptionThrown)
profiled
- The profiled annotation that was attached to the method.joinPoint
- The AbstractJoinPoint encapulates the method around which this aspect advice runs.returnValue
- The value returned from the execution of the profiled method, or null if the method
returned void or an exception was thrown.exceptionThrown
- The exception thrown, if any, by the profiled method. Will be null if the method
completed normally.
protected String getStopWatchMessage(Profiled profiled, AbstractJoinPoint joinPoint, Object returnValue, Throwable exceptionThrown)
profiled
- The profiled annotation that was attached to the method.joinPoint
- The AbstractJoinPoint encapulates the method around which this aspect advice runs.returnValue
- The value returned from the execution of the profiled method, or null if the method
returned void or an exception was thrown.exceptionThrown
- The exception thrown, if any, by the profiled method. Will be null if the method
completed normally.
protected String evaluateJexl(String text, Object[] args, Object annotatedObject, Object returnValue, Throwable exceptionThrown)
text
- The text to be parsed.args
- The args that were passed to the method to be profiled.annotatedObject
- The value of the object whose method was profiled. Will be null if a class method was
profiled.returnValue
- The value returned from the execution of the profiled method, or null if the method
returned void or an exception was thrown.exceptionThrown
- The exception thrown, if any, by the profiled method. Will be null if the method
completed normally.
Profiled.el()
protected org.apache.commons.jexl.Expression getJexlExpression(String expressionText) throws Exception
expressionText
- The JEXL expression text
Exception
- Thrown if there was an error compiling the expression text
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |