[jboss-user] [JBoss AOP] - Re: interceptors stack is static?

bornmw do-not-reply at jboss.com
Fri Feb 1 12:13:12 EST 2008


"kabir.khan at jboss.com" wrote : I fail to see how you would get that behaviour...

I was doing invocation.getInterceptors()[someIndex] = MyDummyInterceptor.
It did the job - interceptor at someIndex was disabled.
But MyDummyInterceptor remained there for all subsequent calls.
Which was a surprise to me - I really thought invocation contained current-invocation-related interceptors stack :)

"kabir.khan at jboss.com" wrote : But you can try to use the following Invocation method instead:
  | 
  |   | Object invokeNext(Interceptor[] newInterceptors) throws Throwable;
  |   | 
  | 

Yes, this way it works.
I'm eventually copying invocation interceptors into a new array, modifying it (not forgetting to remove the current interceptor from it) and calling invokeNext(newInterceptors)

Thanks

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

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



More information about the jboss-user mailing list