[jboss-user] [JBoss AOP] - Re: Intercept Annonation with argument

kabir.khan@jboss.com do-not-reply at jboss.com
Thu Oct 16 07:37:06 EDT 2008


That is not possible. You will have to go with the original pointcut and do some filtering in your advice depending on the value of the annotation, e.g.:


  | public Object invoke(Invocation inv) throws Throwable
  | {
  |    MyAnnotation ma = inv.resolveAnnotation(MyAnnotation.class);
  |    if (ma.value = MyValue.BAR)
  |    {
  |       //Do stuff
  |      return inv.invokeNext();
  |    }
  |    else
  |    {
  |       inv.invokeNext();
  |    }
  | }
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4182631#4182631

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4182631



More information about the jboss-user mailing list