>> >> Have started looking into the FilterChain implementation and here are >> some initial thoughts >> >> 1. Rename IoFilterChain as IoChannel - it gives a more clear picture >> and is easy to understand like imagine as a Channel with multiple >> stages aka IoFilters. >> This came while I was drawing on paper to design something. >> > > Well, I would rather keep the current name. The 'filter' terminology is > quite commonly accepted for such a pattern. Servlet uses it > (http://java.sun.com/blueprints/patterns/InterceptingFilter.html), and it > also refers to the CoR pattern > (http://en.wikipedia.org/wiki/Chain-of-responsibility_pattern).
Got it :-) >> 2. Have captured a couple of API's that are core to IoChannel >> >> IoSession getSession(); >> >> IoFilter getHead(); >> >> IoFilter getNextFilter(IoFilter currentFilter); >> >> List<IoFilter> getAll(); >> >> void addFilter(String name, IoFilter filter); >> >> void addAfter(String baseName, String filterName, >> IoFilter filter); >> >> void removeFilter(String filterName); >> >> There are a lot more API's in current implementation. I am not sure if >> we need replace API or not. >> > > There is something that need to be done in any case : check the current API, > keep what is necessary, remove what is useless. This what I did and brought out important things out. These were based on the use cases for each API that I could think. It will definitely evolve over time. >> Also do we need the Generics version of these API's or its fine without >> them? >> > > The problem is that we are transferring Objects from one filter to the > other, and it's a bit too generic. As already stated, it would be much > better if we can pass a stream of "something", this something could > perfectly be generic. > > Now, a question has been raised about the use of Stream : what about the > semantic of this element, assuming that we will need a non-blocking stream ? Will think in this direction :-) >> >> This is just the initial list. Will checkin the files once the name >> > > Ok, thanks ! -- thanks ashish Blog: http://www.ashishpaliwal.com/blog My Photo Galleries: http://www.pbase.com/ashishpaliwal
