directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Irving, Dave" <>
Subject RE: [mina] Refactoring MINA IoFilterChain (Was: IoFilters: DIRMINA-121 / 122)
Date Tue, 15 Nov 2005 17:26:48 GMT
Jose Alberto wrote:

> Now, as part as the protocol, the client may request 
> TLS privacy once authenticated.
> So, on a particular session, the client requests privacy, 
> which means adding the SSLFilter after threadFilter and activate it. 
> Now I want this change only for this session, not for all the sessions

> on this port. I cannot do SSL at the end of the chain because I need 
> to decode first.

Thanks - that makes perfect sense and I see where you are coming from

> And since you have only one chain (either shared or private) at any
given point in 
> time, the implementation has to be simpler. I do not see how it may
become more complicated.

If we're supporting sharing, then we need the existing proposed changes
to support that. The lazy copying comes on top of this - so Im not sure
the overall change would be simpler.
To support this, we'd need to work out how to do the lazy copying you
are talking about.
I don't think its so simple as IoFilters are initialised with a
NextFilter and are allowed to use that filter at any time to make
requests. So we'd either have to change the way they do this as you
discussed earlier (effects all filter implementations) or we'd have to
make them cloneable (or whatever. Again - effects all filter
Either change is likely to have big impacts - and with my level of Mina
experience I think I'd have to take a back seat and leave it to the
experts (which is the best thing all round if there is a better way to
do this that Im not yet up to implementing).

The only easy way I can think of doing what you want (without requiring
changes to the Filter API) is as follows:

We now have the ability to make "chains of chains" very simply (routing
based on session).
There is nothing to stop us allowing a session to make a chain
"contribution" at any point along the "chain of chains".
E.g, in your IoHandler you realise that your client has requested TLS
which must come before anything else.
You'd do this:

IoFilterChain chain = IoSession.getSessionChainBefore("sessionManager");
// configure the chain how you like

The chain would be created on demand and you could modify it however you
wanted. For all subsequent traffic, your tls filter would be the first
filter used.

Most users would probably not need this however, and would just get the
"regular" session chain:
IoFilterChain sessionChain = IoSession.getFilterChain();

I understand that this may not be good enough: For example, you may now
say that if they want TLS, you should remove some other filter that was
configured at the port level. This solution wouldn't support that as it
stands. (I suppose it would be possible to opt out of filters with more
work though).

So, in summarry (sorry, it was long again), I don't see how the Lazy
Copying can work without changes to the API and semantics of IoFilter -
which Im not experienced enough to contribute to. 
Please let me know if my proposed additional change is likely to be of
use to you.

> Jose Alberto

Many thanks,


This e-mail and any attachment is for authorised use by the intended recipient(s) only. It
may contain proprietary material, confidential information and/or be subject to legal privilege.
It should not be copied, disclosed to, retained or used by, any other party. If you are not
an intended recipient then please promptly delete this e-mail and any attachment and all copies
and inform the sender. Thank you.

View raw message