> From: Niklas Therning [mailto:[EMAIL PROTECTED] > > It's been a really interesting and fun discussion today! :) > > To summarize: > > sessionCreated() can not be relied upon to do filter initialization > since if the filter is added to a chain after the session was created > sessionCreated() won't be called. This means that IoFilter.init() is > needed and it has to be called when added or at least before the first > time any of the other IoFilter-methods is called. And in IoFilter.init() > we know there will be times when we need to get a hold of the session > (see SSLFilter) so IoFilter.init() has to be called every time it is > added to a session. My conclusion is that we should add the session in > the call to init(): > > void init(IoFilterChain parent, NextFilter nextFilter, IoSession session) > > Can we all agree on this now? >
I do. ;-) > I proposed a very simple solution earlier today which in short means > that the chain for a session isn't created until the session is actually > created. It will be extremelly simple to implement but there *might* be > some overhead involved in creating the chain. > > Dave, you seem to be confident that you can sort this out without having > to create a new chain when a new session is created. I do not doubt > that. If you still think it's worth it why don't you have a shot at it? > The question is how complex it will be and if it really will be that > much efficient. I think Dave's approach can be seen as an optimization of the simple approach you proposed. So if we can agree that the signature for init() is as specified above, then I would suggest trying both implementations as the interface would be the same and then see the complexity vs. overhead cost of each implementation. Would this be a feasible approach? Jose Alberto
