I would like to use annotations to define my method pointcuts.

Specifically, I have gone through my source code and have added:

@@OptimisticLockRetry

annotation to all methods I want to have intercepted. This includes a SPACE at 
the end (not sure if this is required by qdox or not when no attributes are 
defined).

My jboss-aop.xml looks like this (without brackets):

aop
  interceptor name="optimisticlockretry" 
class="biz.OptimisticLockRetryInterceptor"/

  pointcut name="optimisticLockRetryMethods" expr="execution(public static * 
biz.*->@OptimisticLockRetry(..))"/

  bind pointcut="optimisticLockRetryMethods"
     interceptor-ref name="optimisticlockretry"/
  /bind
/aop>

My understanding is, that in my Ant build file I should compile all my class 
files, then run annotationC, then run AOPC.

My build is failing on the annotationC step. I should note that before 
introducing Annotations, my JBoss AOP setup worked fine.

I have defined an empty interface named "biz.OptimisticLockRetry" (again, not 
sure if this is required or not. I've tried with and without).

The Ant task to run AnnotationC is as follows:

 annotationc compilerclasspathref="aop.classpath.path.id" 
classpath="${classes.dest.dir}" bytecode="true"
            src path="${src.dir}"/
        /annotationc>

However, I get parsing error complaining about tokens that are not in my source 
files. My thinking is that annotationC is picking up my CVS files. I've tried 
several ways of changing up the  tag, and can get it to run, but nothing 
changes on my files.

So, my questions are:

1- Is my understanding correct in how Annotations can be used to define my 
pointcuts?
2- How can I define my annotationc Ant Task to execute this tool correctly. I 
would like to precompile my classes the same I way I was before, but by using 
Annotations rather than naming expressions.

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

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


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
JBoss-Development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to