org.perf4j.aop
Class AbstractEjbTimingAspect
java.lang.Object
org.perf4j.aop.AgnosticTimingAspect
org.perf4j.aop.AbstractEjbTimingAspect
- Direct Known Subclasses:
- EjbTimingAspect, EjbTimingAspect, EjbTimingAspect, EjbTimingAspect
public abstract class AbstractEjbTimingAspect
- extends AgnosticTimingAspect
This is the base class for TimingAspects that use the EJB interceptor framework.
Subclasses just need to implement the newStopWatch(java.lang.String, java.lang.String)
method to use their logging framework of choice
(e.g. log4j or java.logging) to persist the StopWatch log message.
- Author:
- Alex Devine
Method Summary |
Object |
doPerfLogging(javax.interceptor.InvocationContext ctx)
This is the interceptor that runs the target method, surrounding it with stop watch start and stop calls. |
protected abstract LoggingStopWatch |
newStopWatch(String loggerName,
String levelName)
Subclasses should implement this method to return a LoggingStopWatch that should be used to time the wrapped
code block. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractEjbTimingAspect
public AbstractEjbTimingAspect()
doPerfLogging
public Object doPerfLogging(javax.interceptor.InvocationContext ctx)
throws Exception
- This is the interceptor that runs the target method, surrounding it with stop watch start and stop calls.
- Parameters:
ctx
- The InvocationContext will be passed in by the Java EE server.
- Returns:
- The return value from the executed method.
- Throws:
Exception
- Any exceptions thrown by the executed method will bubble up.
newStopWatch
protected abstract LoggingStopWatch newStopWatch(String loggerName,
String levelName)
- Subclasses should implement this method to return a LoggingStopWatch that should be used to time the wrapped
code block.
- Parameters:
loggerName
- The name of the logger to use for persisting StopWatch messages.levelName
- The level at which the message should be logged.
- Returns:
- The new LoggingStopWatch.
Copyright © 2008-2011 perf4j.org. All Rights Reserved.