[jboss-user] [JBoss AOP] - Write invocation not being called for arrayreplacement

sgoyette do-not-reply at jboss.com
Wed Apr 1 12:17:49 EDT 2009


Hi All,

I've been pulling my hair out with this one for some time.  I'm trying to intercept reads and writes to an array.  Reading is working really well but I cannot for the life of me get the writes to work.  Here's is mu jboss-aop.xml file:

  | <?xml version="1.0" encoding="UTF-8"?>
  | <aop>
  |    	<interceptor class="com.intuit.tax.engine.group.TSingleGroupInterceptor"/>
  |    	
  |    	<arrayreplacement class="com.intuit.tax.engine.group.TSingleGroup" />
  |    	<prepare expr="field(* com.intuit.tax.engine.group.TSingleGroup->R)"/>
  |    	<prepare expr="field(* com.intuit.tax.engine.group.TSingleGroup->B)"/>
  |    	<prepare expr="field(* com.intuit.tax.engine.group.TSingleGroup->S)"/>
  |    	
  |    	<arraybind type="READ_WRITE">
  |        <interceptor-ref name="com.intuit.tax.engine.group.TSingleGroupInterceptor"/>
  |    	</arraybind>
  | </aop>
  | 

This calls this function within the TSingleGroupInterceptor:


  | 	public Object invoke(Invocation invocation) throws Throwable {
  | 
  | 		List<ArrayReference> refs = ArrayRegistry.getInstance().getArrayOwners(invocation.getTargetObject());
  | 		logger.debug("Owner is " + refs.get(0).getRootObject().getClass().getName() );
  | 		
  | 		// These objects should only have a single owner
  | 		TSingleGroup group = (TSingleGroup)refs.get(0).getRootObject();
  | 		if ( invocation instanceof ArrayElementReadInvocation) {
  | 			logger.debug("Read invocation");
  | 			return invoke((ArrayElementReadInvocation) invocation, group);
  | 		} else if (invocation instanceof ArrayElementWriteInvocation) {
  | 			logger.debug("Write invocation");
  | 			return invoke((ArrayElementWriteInvocation) invocation, group);
  | 		}
  | 		logger.debug("No match for read/write.  Invocation is: " + invocation.getClass().getName() );
  | 		throw new RuntimeException("This interceptor is for arrays");
  | 	}
  | 

Write invocation is never logged and neither is "No match for read/write".

What am I doing wrong?  Can anyone help?

Thanks,

Steve

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

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



More information about the jboss-user mailing list