[jboss-user] [JBoss AOP] - annotation

system.out do-not-reply at jboss.com
Mon Jun 11 12:56:05 EDT 2007


I am trying to tag the intercepted methods individually using annotation as described in userguide 4.1. Methods and annotations.

I created a sample code and it is working fine (similar to Method Interception Sample).  However when I tried to apply similar approach to intercept the session bean, interception didn't happen:

Here is the jboss-aop.xml:
<aop>
  | 	<aspect class="OnewayAspect" />
  | 	<bind pointcut="execution(void *->@Oneway(..))">
  | 		<advice name="oneway" aspect="OnewayAspect" />
  | 	</bind>
  | </aop>

all methods in session bean have Oneway annotation !!  

After that I modified the jboss-aop.xml with the following:
   <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>
It was intercepted!  

Can anybody tell me what is wrong?  


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

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



More information about the jboss-user mailing list