"Rickard �berg" wrote:
> 
> Hiram Chirino wrote:
> 
> > Since it seems like the configuration would define a static stack of
> > interceptors, MGMT could build a java.util.Stack containing the
> > interceptors and pass that down.  Avoiding the delegation back to it.
> 
> Yes, pass it down along with the MI. That'd work. Didn't figure that one
> out initially. That would indeed be much better.

I agree, this way we avoid doubling the number of
calls in the chain.

But creating and using a Stack on every call would
also be slow. And it is not needed since the chain
instance configuration is basically static, once
created.
We could delegate the task of getting the next
interceptor to the MI by adding a method
MI.getNextInterceptor(). The MI constructor could
then have an extra argument typed as an array of
interceptors. This array is created and initialized
once by MGMT at interceptor chain configuration
time, and never changed by the MI. The MI could then
have an instance field denoting the index of the
next interceptor in the chain. This field would be
incremented at each call to the MI.getNextInterceptor()
method.

I guess this approach would also make dynamic
interceptor chain reconfiguration easy.


Best Regards,

Ole Husgaard.

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to