On Fri, Aug 26, 2011 at 3:24 PM, Alan D. Cabrera <[email protected]> wrote: > > On Aug 26, 2011, at 4:14 AM, Julien Vermillard wrote: > >> I modified the API to remove IoFilterChain. Now you are supposed to >> give a list of filter to the service before starting it : >> >> // create the fitler chain for this service >> List<IoFilter> filters = new ArrayList<IoFilter>(); >> filters.add(new LoggingFilter("byte log filter")); >> filters.add(new MyCodecFilter()); >> filters.add(new LoggingFilter("pojo log filter")); >> filters.add(newMyProtocolLogicFilter()); >> >> acceptor.setFilters(filters); >> >> acceptor.bind(...); > > > How do we make chains where two filters feed into one or one filter feeds two > filters? If you look in my sandbox we can accommodate this via: > > static import a.m.util.Util. linkParentWithChild; // to be written > > IoFilter foo = new FooFilter(); > IoFilter link = new LinkStateFilter(); > IoFilter checksum = new ChecksumFilter(); > IoFilter log = new LogFilter(); > > link.addLinkStateListener(foo); > linkParentWithChild(foo, checksum); > linkParentWithChild(link, checksum); > linkParentWithChild(checksum, log); > > acceptor.setFilters(foo); > About the code in the sandbox : http://svn.apache.org/repos/asf/mina/sandbox/adc/ahc/mina3/src/main/java/org/apache/mina/core/IoFilter.java I see no IoFilter.addLinkStateListener(..) method, am I looking at the right place ?
About the "filters feed into one or one filter feeds two filters", do you have a concrete use case in mind for that ?
