net.sf.seam.perf4j
Class SeamTimingAspect

java.lang.Object
  extended by org.perf4j.aop.AgnosticTimingAspect
      extended by net.sf.seam.perf4j.SeamTimingAspect

public class SeamTimingAspect
extends AgnosticTimingAspect

An implementation of Perf4j's AgnosticTimingAspect using Seam Logger to log results.

Author:
Marcin ZajÄ…czkowski, 2010-01-30

Constructor Summary
SeamTimingAspect()
          Causes default logger and default message generator to be used.
SeamTimingAspect(org.jboss.seam.log.Log logger)
          Allows to specify a logger to be used.
 
Method Summary
 Object doPerfLogging(SeamJoinPoint sjp, Profiled profiled)
          Executes the real profiling method from Perf4j.
protected  LoggingStopWatch newStopWatch(String loggerName, String levelName)
          Returns an implementation of StopWatch using Seam logger.
 
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

SeamTimingAspect

public SeamTimingAspect()
Causes default logger and default message generator to be used.


SeamTimingAspect

public SeamTimingAspect(org.jboss.seam.log.Log logger)
Allows to specify a logger to be used. Messages will be generated using default message generator defined in Perf4j library.

Parameters:
logger - logger to be used
Method Detail

doPerfLogging

public Object doPerfLogging(SeamJoinPoint sjp,
                            Profiled profiled)
                     throws Throwable
Executes the real profiling method from Perf4j.

Parameters:
sjp - seam join point
profiled - profiled annotation from profiled method
Returns:
return value from executed methof
Throws:
Throwable - exception thrown by executing method

newStopWatch

protected LoggingStopWatch newStopWatch(String loggerName,
                                        String levelName)
Returns an implementation of StopWatch using Seam logger. The logger passed through constructor is used if available. Otherwise default Seam logger is obtained.

Parameters:
loggerName - logger name passed to StopWatch
levelName - logging level name passed to StopWatch
Returns:
LoggingStopWatch implementation TODO: MZA: level names for Seam have to be standarized.


Copyright © 2010. All Rights Reserved.