Comment puis-je les méthodes d'accès aux attributs avec Spring AOP (AspectJ-style)?

J'ai besoin de intrecept certaines méthodes et de leurs attributs à l'aide d'annotations en tant que point de coupures, mais comment puis-je accéder à ces attributs de méthode. J'ai code suivant qui ont peut exécuter du code avant la méthode est exécutée, mais je ne sais pas comment je peux accéder à ces attrbiutes.

package my.package;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class MyAspect {

 @Pointcut(value="execution(public * *(..))")
 public void anyPublicMethod() {
 }

 @Around("anyPublicMethod() && @annotation(myAnnotation )")
 public Object myAspect(ProceedingJoinPoint pjp, MyAnnotation myAnnotation)
    throws Throwable {

  //how can I access method attributes here ?
  System.out.println("hello aspect!");
  return pjp.proceed();
 }
}

OriginalL'auteur newbie | 2010-10-27