Hi Erix,

IoFilter is used to process messages in the filter chain between the network
(IoAcceptor / IoConnector) and the IoHandler.  The same IoFilter can be
added to more than one different filter chain, such as on different
sessions.

NextFilter represents the IoFilter's membership in the filter chain.  So,
even though the IoFilter might be shared, there is still a different
NextFilter instance for each time the shared IoFilter was added to a filter
chain.

This design allows the IoFilter implementor to remain unaware of the exact
IoFilter that comes next in the chain.  So, if IoFilters are added or
removed from the filter chain dynamically, the NextFilter instance passed
into the IoFilter remains unchanged and automatically propagates calls to
the right IoFilter, based on the state of the filter chain when the call is
made.

Hope this helps,
-john.

On Fri, Oct 3, 2008 at 7:36 PM, Erix Yao <[EMAIL PROTECTED]> wrote:

> Why the NextFilter interface is defined?
> What is its special purpose?
> It has almost the same interface with IoFilter, why define them again ?
> Or we can let NextFilter extends IoFilter.
>



-- 
>|< Kaazing Corporation >|<
John Fallows | CTO | +1.650.943.2436
800 W. El Camino Real, Ste 180 | Mountain View, CA 94040, USA

Reply via email to