On Fri, 21 Sep 2001, Bojan Smojver wrote:

> > A simpler solution is to fix ReloadInterceptor - and save the current list
> > of interceptors before removing the context, then add all per/context
> > interceptors after the context is added back ( those having getContext()
> > != null ).
>
> Just to be clear on what you meant here, if there was, for instance this
> JDBCRealm local interceptor object, you'd just store its reference
> ,somewhere else while context is being reloaded and then attach the same
> object back as an interceptor after the reload is done.
>
> I was thinking about that but what if that old instance of the
> interceptor object relied on something in the old context? That would
> screw things up. But if that's not the case (ie. there can't be any
> relationship with the context), it should be fine. Still don't know
> enough to tell.

You should call setContext() and reload() on the interceptor to let it
know the new context, and the module should be able to handle this - you
may need to do additional fixes in the module.

In general I think each module should be able to deal with:
- dynamic context add/remove
- context reloading
- module reloading ( in future )

> My understanding is that ContextXmlReader actually produces 'fresh'
> instances every time.

True. Do you think it would be better ( or simpler ) to just change
ContextXmlReader to create a new set of per/context interceptors ?

My thinking was that the interceptors should be 'smart' about reloading,
maybe they need to save/restore some state ( like a session interceptor ),
or do some other actions.

Costin

Reply via email to