Tuesday, June 29, 2010

Spring Framework AspectJ Annotations

For defining aspects, Spring leverages the set of annotations
provided by AspectJ.


Annotation
Use
Description

@Aspect Type Declares a class to be an aspect.

@After Method Declares a method to be called after a
pointcut completes.


@AfterReturning
Method Declares a method to be called after a
pointcut returns successfully.


@AfterThrowing
Method Declares a method to be called after a
pointcut throws an exception.



@Around Method Declares a method that will wrap the
pointcut.



@Before
Method Declares a method to be called before
proceeding to the pointcut.

@DeclareParents Static Field Declares that matching types should be
given new parents—that is, it introduces new
functionality into matching types.


@Pointcut Method Declares an empty method as a pointcut
placeholder method.

No comments:

Post a Comment