directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jose Alberto Fernandez" <>
Subject RE: [mina] Refactoring MINA IoFilterChain (Was: IoFilters: DIRMINA-121 / 122)
Date Tue, 15 Nov 2005 13:20:35 GMT
> From: Irving, Dave []
> It kind of boils down to a few points:
> 1) We want to chain "sequences" of filters (a filter chain) together

Ok, why is it that we want to do this? What is it that we are trying to

> 2) Why not make IoFilterChain move towards the composite pattern? A
> filter chain is just a special type of filter which filters in a
> sequence. No special head, no special tail. Just a sequence 0..n. So
> given some "BasicFilterChain" impl, we can add both individual filters
> and filter chains to the chain. NextFilters can ** still ** be cached
> individual filters - no change there.

Well, you could define today your own filter that encapsulates a filter
chain inside and that does this propagation. The only thing you cannot
do with such an arrangement is modify the encapsulated chain from
outside (unless you know is being encapsulated and make the
corresponding calls on the encapsulating filter).

public class EncapsulatedChainFilter(IoFilterChain chain) {
	// Implementation delegates all methods to the chain and the
head and tail use the nextfilter object to connect up or down as

Jose Alberto

View raw message