[jboss-user] [JBoss AOP] - Re: Strange problem of aspectizing EJBs

vola do-not-reply at jboss.com
Tue Jul 10 16:17:41 EDT 2007


Ok...I think I know the reason now....

Seems like once my "Duke's Bank" application deployed into JBoss, it will be wrapped up by some proxy class....

I change my jboss-aop.xml to:

  |    <bind pointcut="execution(* $Proxy74->withdraw(..))">
  |        <interceptor class="com.sun.ebank.aop.SimpleInterceptor2"/>
  |    </bind>
  | 

instead of 


  |    <bind pointcut="execution(* com.sun.ebank.ejb.tx.TxControllerBean->withdraw(..))">
  |        <interceptor class="com.sun.ebank.aop.SimpleInterceptor2"/>
  |    </bind>
  | 

Surprisely, it works...One thing I am really confused is why "injbossaop" example does not have this kind of problem? 

In "injbossaop" example's jboss-aop.xml:

  |    <typedef name="MySessionBeans" expr="class($instanceof{javax.ejb.SessionBean}) AND class(org.jboss.injbossaop.ejb.*)" />	
  |    <bind pointcut="execution(* $typedef{MySessionBeans}->getValue(..))">
  |        <interceptor class="org.jboss.injbossaop.lib.SimpleInterceptor"/>
  |    </bind>
  | 

Could anyone tell me how to avoid the "proxy"?

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

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



More information about the jboss-user mailing list