[jboss-user] [JBoss AOP] - Abstract and aop

wiktorowski maximilien do-not-reply at jboss.com
Mon Sep 20 12:06:50 EDT 2010


wiktorowski maximilien [http://community.jboss.org/people/maximilien] created the discussion

"Abstract and aop"

To view the discussion, visit: http://community.jboss.org/message/562734#562734

--------------------------------------------------------------
hi

i have a newbie jboss aop question, maybe someone can help me

I have an abstract class defining method1
And 2 subclasses Class1 and Class2

I'd like to intercept differently the call to Class1.method1 and Class2.method1 but i didn't success.

I've tried

<bind pointcut="execution(public void $instanceof{AbstractClass}->method1()) AND class(Class1)">
     <advice aspect="MyAspect" name="class1Method"/>
</bind>
 
<bind pointcut="execution(public void Class2->method1())">
     <advice aspect="MyAspect" name="class2Method"/>
</bind>


and 

<bind pointcut="execution(public void Class1->method1())">
     <advice aspect="MyAspect" name="class1Method"/>
</bind>
 
<bind pointcut="execution(public void Class2->method1())">
     <advice aspect="MyAspect" name="class2Method"/>
</bind>

<bind pointcut="execution(public void eu.mpulse.messaging.services.mdb.dlq.DLQConsumerBean->onMessage(javax.jms.Message))">
         <advice aspect="MessageTracker" name="m



essageRemoved"/>
        </bind<bind pointcut="execution(public void Class1->method1())">
     <advice aspect="MyAspect" name="class1Method"/>
 </bind>
--------------------------------------------------------------

Reply to this message by going to Community
[http://community.jboss.org/message/562734#562734]

Start a new discussion in JBoss AOP at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2027]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100920/680bf344/attachment.html 


More information about the jboss-user mailing list