Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 46538 invoked from network); 9 Sep 2006 01:02:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 9 Sep 2006 01:02:20 -0000 Received: (qmail 3579 invoked by uid 500); 9 Sep 2006 01:02:13 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 3534 invoked by uid 500); 9 Sep 2006 01:02:13 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 3523 invoked by uid 99); 9 Sep 2006 01:02:13 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2006 18:02:13 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [199.237.51.194] (HELO green.rootmode.com) (199.237.51.194) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2006 18:02:11 -0700 X-ClientAddr: 68.171.62.46 Received: from [192.168.15.104] (68-171-62-46.vnnyca.adelphia.net [68.171.62.46]) by green.rootmode.com (8.12.10/8.12.10) with ESMTP id k8911PxQ025322 for ; Fri, 8 Sep 2006 21:01:28 -0400 Mime-Version: 1.0 (Apple Message framework v752.2) In-Reply-To: <00489BAD-8768-4F43-A918-E2A7D54632D6@visi.com> References: <00489BAD-8768-4F43-A918-E2A7D54632D6@visi.com> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <56CE7A15-30F6-4D9A-913B-14C0F5FCB9AA@iq80.com> Content-Transfer-Encoding: 7bit From: Dain Sundstrom Subject: Re: How do swing apps work? Date: Fri, 8 Sep 2006 18:01:41 -0700 To: dev@geronimo.apache.org X-Mailer: Apple Mail (2.752.2) X-RootMode-MailScanner-Information: Please contact the ISP for more information X-RootMode-MailScanner: Found to be clean X-MailScanner-From: dain@iq80.com X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On Sep 8, 2006, at 5:24 PM, David Blevins wrote: > On Sep 8, 2006, at 4:51 PM, David Jencks wrote: > >> I fiddled around a bit and got the daytrader streamer app client >> to work on trunk (except I might have broker the update timer). >> However, to do this I had to add code so the main method doesn't >> return until the app exits: otherwise it returns and our app >> client container shuts down the kernel. >> >> How do standalone swing apps work? Do the main methods return >> more or less immediately or do they block somehow or get used >> somehow until the app is ready to close? >> >> If they return immediately can anyone suggest a way to detect that >> the app has exited so we can stop the kernel and exit the container? >> >> hoping someone somewhere has written a swing app :-) > > I have in a former life. It's the same as server software -- when > there are nothing but daemon threads left, you exit. Some people > keep the main method alive (as that thread is not a daemon > thread). Some people launch off another non-daemon thread and let > main return. > > I know I'm telling you things you already know, so I guess my > question is what's wrong with using the finalize method to stop the > kernel and exit the container? Finalizers are evil. They can easily be replaced by a PhantomReference or a shutdown hook. -dain