[jboss-user] [JBoss AOP] - Re: AOP within TestNG & EJB3 Embeddable

kabir.khan@jboss.com do-not-reply at jboss.com
Wed May 2 13:59:59 EDT 2007


"mzeijen" wrote : What I want to do is to replace the HTTPClient (that makes the http call) with a Mock object. This mock object simply returns the value that I expect. I was thinking that AOP could be de the elegant solution for me. I am new to AOP so maybe I am seeing this completely wrong. 
  | 
This sounds like a good idea to me.

"mzeijen" wrote : The problem is that I am having problems getting AOP to work within the Embeddable JBoss. I created a META-INF/jboss-aop.xml file and I am sure that it got loaded, because it throws exceptions if I do something wrong within the file. But as soon as the AOP should spring into action and call an Interceptor class nothing happens. 
  | 
  | Does someone else have any expierence with AOP and EJB3 Embeddable? 
  | 
I have not really tried JBoss AOP with E-EJB, but it should be possible. As you say, it sounds like the jboss-aop.xml is getting picked up. So from that I *guess* you have runtime weaving turned on. If that is the case, and your classes are being woven, I would guess that your pointcuts are wrong. Remember that everything needs to be fully qualified. e.g


  | <bind pointcut="execution(* org.acme.POJO->send(java.lang.String))">
  |   ...
  | </bind>
  | 
would work, while the following 2 won't

  | <bind pointcut="execution(* org.acme.POJO->send(String))">
  |   ...
  | </bind>
  | <bind pointcut="execution(* POJO->send(java.lang.String))">
  |   ...
  | </bind>
  | 


You can pass in 
-Djboss.aop.verbose=true to see if the different bindings in your file are matching the relevant joinpoints.

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

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



More information about the jboss-user mailing list