From: Trustin Lee [mailto:[EMAIL PROTECTED]
Sent: 17 November 2005 12:00
To: Apache Directory Developers List
Subject: Re: [jira] Commented: (DIRMINA-121) Per-port filter chain

 

2005/11/17, Jose Alberto Fernandez <[EMAIL PROTECTED]>:

Ok, can someone explain to me, how can a filter propagate an event
asynchronously (I presume to all the sessions using it) without knowing
what those sessions are? How can a filter make one call in its cached
NextFilter and the message be received by ALL the sessions sharing that
chain?


Request-response timeout filter is a good example.

It is a filter that fires exceptionCaught() event if a response for a request message is not received for certain period.  We'll have to invoke nextFilter.exceptionCaught().  Of course, nextFilter instance should be stored per session as you pointed out.  But I don't think we need getNextFilter() method in IoSession; it looks weird.


I just looked again at the interface IofilterChain there are  methods there:

 

NextFilter getNextFilter( IoFilter filter );

 

NextFilter getNextFilter( String name );

 

And of course I can get to the IoFilterChain from the session. So the API is already there, I am not adding anything.

 

So, as your filter needs to remember the session, there is no need for it to remember NextFilter.

 

Jose Alberto

 

Reply via email to