Return-Path: Delivered-To: apmail-mina-dev-archive@www.apache.org Received: (qmail 43870 invoked from network); 7 Nov 2008 10:00:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2008 10:00:51 -0000 Received: (qmail 90640 invoked by uid 500); 7 Nov 2008 10:00:56 -0000 Delivered-To: apmail-mina-dev-archive@mina.apache.org Received: (qmail 90613 invoked by uid 500); 7 Nov 2008 10:00:56 -0000 Mailing-List: contact dev-help@mina.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@mina.apache.org Delivered-To: mailing list dev@mina.apache.org Received: (qmail 90602 invoked by uid 99); 7 Nov 2008 10:00:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2008 02:00:56 -0800 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [62.206.1.20] (HELO mail-out03.broadnet-mediascape.de) (62.206.1.20) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 07 Nov 2008 09:59:38 +0000 Received: (qmail 15923 invoked by uid 111); 7 Nov 2008 10:00:14 -0000 Received: from 212.110.223.68 by mail-out03 (envelope-from , uid 104) with qmail-scanner-1.25 (trophie: 7.510-1002/643/20820. Clear:RC:1(212.110.223.68):. Processed in 0.168701 secs); 07 Nov 2008 10:00:14 -0000 X-Qmail-Scanner-Mail-From: steve.ulrich@proemion.com via mail-out03 X-Qmail-Scanner: 1.25 (Clear:RC:1(212.110.223.68):. Processed in 0.168701 secs) Received: from gate01.rmcan.com (HELO rmsv008.rmcorp.rm-michaelides.com) (212.110.223.68) by mail-out03.broadnet-mediascape.de with SMTP; 7 Nov 2008 10:00:13 -0000 From: Steve Ulrich To: "dev@mina.apache.org" Date: Fri, 7 Nov 2008 11:00:10 +0100 Subject: RE: [Chain refactoring] Some fedback and ideas no--signature Message-ID: <079C41B129004A4ABAFA9562B3C0C00D023C679B29@rmsv008.rmcorp.rm-michaelides.com> References: <4913A11F.5060107@nextury.com> In-Reply-To: <4913A11F.5060107@nextury.com> Content-Language: de-DE Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org > Emmanuel Lecharny [mailto:elecharny@gmail.com] wrote: > > Hi guys, Hi! > here are some thoughts and ideas I have had those last few days, > thoughts that I have experimented in branches. It's not finished yet, > but I think I have something likely to work well and be easier to use > than the current implementation. > > So here are the gathered thoughts, please feel free to give me feedback > : > > > Refactoring the current chain : possible implementations [snip] > --------------------------------------------------------- > > 2) Proposed solutions > --------------------- > [snip] In my opinion, the 2.1 and 2.2 solution is nearly the same, just the way yo= u iterate the filter is different: 2.1: Iterations outside of the filter (Con: no pre/post processing) 2.3: Index based iteration inside the filter (Con: looks ugly to me ;-), in= dices aren't safe if you use ExecutorFilter) 2.2 is somewhat different: You're using a simple kind of LinkedList and pas= s the current filter the entry of the "next" element > > 3) Choice > --------- > > If we cant to keep all the existing functionalites MINA has, solution > 2.3 is obviously the way to go. Well implemented, it will also be fast > and easy to debug, and, last, not least, it's close to what we curently > have, but with less code and a better interface. I think a combination of the three would be good: An Iterator like object is passed to the Filter: processEventXXX(message, chainIterator){ //preprocessing chainIterator.next().processEventXXX() //postprocessing } This way you don't need to deal witch an index. If the data the Iterator is based of is immutable, synchronization isn't ne= eded. Just replace the data and the next created iterator will use it. Pro: No need for ugly and unsage indices No need to decide wich way to iterate the list, bottom-up or top-down are= handled by different iterators Synchronisation isn't needed Pre and post processing easy usage, easy implementation Con: overhead for iterator creation ? regards Steve