Package org.perf4j.aop

Provides annotations that work with an aspect-oriented framework like AspectJ, Spring AOP or EJB interceptors to allow timing of code blocks without explicit logging statements.

See:
          Description

Interface Summary
AbstractJoinPoint AOP-framework agnostic join point.
 

Class Summary
AbstractEjbTimingAspect This is the base class for TimingAspects that use the EJB interceptor framework.
AbstractTimingAspect This is the base class for TimingAspects that use the AspectJ framework (a better name for this class work probably be AspectJTimingAspect, but for backwards compatibility reasons it keeps the AbstractTimingAspect name).
AgnosticTimingAspect This AgnosticTimingAspect class contains all the logic for executing a profiled method with appropriate timing calls, but in an AOP-framework-agnostic way.
DefaultProfiled This unusual concrete implementation of this Profiled annotation interface is used for cases where some interception frameworks may want to profile methods that DON'T have a profiled annotation (for example, EJB 3.0 interceptors).
 

Annotation Types Summary
Profiled The Profiled annotation is used in concert with the log4j or javalog TimingAspects to enable unobtrusive performance logging.
 

Package org.perf4j.aop Description

Provides annotations that work with an aspect-oriented framework like AspectJ, Spring AOP or EJB interceptors to allow timing of code blocks without explicit logging statements. The Profiled annotation can be added to method declarations to indicate that method execution should be timed, e.g.:

 @Profiled(tag = "servlet{$this.servletName}_{$0.pathInfo}")
 protected void doGet(HttpServletRequest req, HttpServletResponse res) {
 ...
 }
 
Timing code can then be enabled using the concrete subclasses of AbstractTimingAspect, such as the log4j TimingAspect. You will need to use an aspect framework such as AspectJ or Spring AOP to enable these aspects.

In addition, if you are using an aspect framework that doesn't use the AspectJ annotations, you can wrap or subclass AgnosticTimingAspect in a manner to work with your framework's requirements.

See Also:
The Perf4J Developer Guide AOP Overview, ajc, the AspectJ compiler/weaver, Load-Time Weaving with AspectJ, Spring AOP


Copyright © 2008-2011 perf4j.org. All Rights Reserved.