[jboss-user] [JBoss AOP] - FieldWriteInvocation.getValue does not reflecting changes made along interceptors
Rick Dong
do-not-reply at jboss.com
Fri Nov 19 19:41:26 EST 2010
Rick Dong [http://community.jboss.org/people/rick.dong] created the discussion
"FieldWriteInvocation.getValue does not reflecting changes made along interceptors"
To view the discussion, visit: http://community.jboss.org/message/572061#572061
--------------------------------------------------------------
I have two field write interceptors A and B that is instrumented on a particular fileld. A gets invoked before B. Can someone please confirm whether the following should work?
{code}
A extends Interceptor
{
public final Object invoke(Invocation invocation) throws Throwable
{
if (invocation instanceof FieldWriteInvocation)
{
FieldWriteInvocation fwi = (FieldWriteInvocation)invocation;
Integer value = fwi.getValue(); //value here is 1 suppose
fwi.setValue(2); //change the value
}
return invocation.invokeNext();
}
after A is done, B is invoked
B extends Interceptor
{
public final Object invoke(Invocation invocation) throws Throwable
{
if (invocation instanceof FieldWriteInvocation)
{
FieldWriteInvocation fwi = (FieldWriteInvocation)invocation;
Integer value = fwi.getValue(); //value here should've been 2, but still is 1 (bug??)
}
return invocation.invokeNext();
}
{code}
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/572061#572061]
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/20101119/2bcac4ae/attachment.html
More information about the jboss-user
mailing list