org.perf4j.aop
Class AbstractEjbTimingAspect

java.lang.Object
  extended by org.perf4j.aop.AgnosticTimingAspect
      extended by 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

Constructor Summary
AbstractEjbTimingAspect()
           
 
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 org.perf4j.aop.AgnosticTimingAspect
evaluateJexl, getJexlExpression, getStopWatchMessage, getStopWatchTag, runProfiledMethod
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEjbTimingAspect

public AbstractEjbTimingAspect()
Method Detail

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.