Return-Path: Delivered-To: apmail-mina-dev-archive@www.apache.org Received: (qmail 46823 invoked from network); 20 Jan 2007 23:21:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Jan 2007 23:21:40 -0000 Received: (qmail 91461 invoked by uid 500); 20 Jan 2007 23:21:46 -0000 Delivered-To: apmail-mina-dev-archive@mina.apache.org Received: (qmail 91442 invoked by uid 500); 20 Jan 2007 23:21:46 -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 91433 invoked by uid 99); 20 Jan 2007 23:21:45 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jan 2007 15:21:45 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of trustin@gmail.com designates 64.233.162.231 as permitted sender) Received: from [64.233.162.231] (HELO nz-out-0506.google.com) (64.233.162.231) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 20 Jan 2007 15:21:37 -0800 Received: by nz-out-0506.google.com with SMTP id l8so628713nzf for ; Sat, 20 Jan 2007 15:21:16 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=o5J1cI0N0hWc1zGjtvzY1rwfono7r4nPL+uEMXjwO4yk5AfpmGgL3noB8Mt6WRzUReXod4NFvxPGn4HuanAPjHHCmdrYWt4kKJdrQbda979eQ7C2+UpneR7+PVjkkumfUDB6CgfaELIRJpFuFZey57tziNvyB+thv5Ni89/V9WQ= Received: by 10.35.50.5 with SMTP id c5mr2302902pyk.1169335276268; Sat, 20 Jan 2007 15:21:16 -0800 (PST) Received: by 10.35.68.13 with HTTP; Sat, 20 Jan 2007 15:21:16 -0800 (PST) Message-ID: <768dcb2e0701201521x382e0c58nf2120a361cdf307b@mail.gmail.com> Date: Sun, 21 Jan 2007 08:21:16 +0900 From: "Trustin Lee" To: dev@mina.apache.org Subject: Re: ThreadPoolFilter In-Reply-To: <470f7e2d0701160219r222c53bdhbe6c5a8c103015df@mail.gmail.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_145977_20348154.1169335276215" References: <470f7e2d0701120121p7c09ab80ue2048667ef8e0f20@mail.gmail.com> <1168594061.5990.3.camel@localhost> <768dcb2e0701141941l13086747y5f033261a1fe1235@mail.gmail.com> <470f7e2d0701150304q75750fbcxe73014f2bed4259e@mail.gmail.com> <768dcb2e0701151758t79e0755bh45fe84ab77b75eb1@mail.gmail.com> <470f7e2d0701160133p25d8a6b3we09349432575b908@mail.gmail.com> <470f7e2d0701160219r222c53bdhbe6c5a8c103015df@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_145977_20348154.1169335276215 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Peter, On 1/16/07, peter ellis wrote: > > Actually Ive stumbled across a class which basically has its own > ThreadExecutor....quite simply this class knows nothing about mina and > works in this fashion as i understand it... > > An event (of some sort) hits the EventsManager Class and delegates the > event to a thread... > > resulting in the following... > > private ExecutorService eventDispatcher = > Executors.newFixedThreadPool(3, new DispatcherThreadFactory()); > > > //then there is a staic class declare within the ManagerClass > > static class DispatcherThreadFactory implements ThreadFactory { > > private int THREAD_COUNT = 0; > > public Thread newThread(Runnable runnable) { > return new Thread(runnable, "NotificationEventDispatcher-" > + THREAD_COUNT++); > } > } > > > Most of the rest of the code uses the listener/observer pattern so > there are a number of clients registered and and dealt with by the > thread pool! > > after speaking with one of the C++ developers he advises me that as > there is a thread pool block of code there then it might be doing all > this stuff anyway meaning you dont need to add anything to mina i.e. i > dont need to add... > > acceptor.getDefaultConfig().setThreadModel(ThreadModel.MANUAL); > acceptor.getFilterChainBuilder().addLast("...", new ExecutorFilter(....)); > > ???? > > Silly question but what would this give me if I did add it to my > MinaXMLServer class!? If your server is already using it's own event dispatcher thread pool, you won't need to add any thread pool in MINA-side. By default, MINA 1.0 adds one thread pool, so you have to disable it: acceptor.getDefaultConfig().setThreadModel(ThreadModel.MANUAL); That's all. :) HTH, Trustin -- what we call human nature is actually human habit -- http://gleamynode.net/ -- PGP key fingerprints: * E167 E6AF E73A CBCE EE41 4A29 544D DE48 FE95 4E7E * B693 628E 6047 4F8F CFA4 455E 1C62 A7DC 0255 ECA6 ------=_Part_145977_20348154.1169335276215--