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&...]