Return-Path: Delivered-To: apmail-jakarta-avalon-dev-archive@apache.org Received: (qmail 89857 invoked from network); 7 Jun 2002 20:39:42 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 7 Jun 2002 20:39:42 -0000 Received: (qmail 917 invoked by uid 97); 7 Jun 2002 20:39:46 -0000 Delivered-To: qmlist-jakarta-archive-avalon-dev@jakarta.apache.org Received: (qmail 877 invoked by uid 97); 7 Jun 2002 20:39:46 -0000 Mailing-List: contact avalon-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Avalon Developers List" Reply-To: "Avalon Developers List" Delivered-To: mailing list avalon-dev@jakarta.apache.org Received: (qmail 854 invoked by uid 98); 7 Jun 2002 20:39:45 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Reply-To: From: "Berin Loritsch" To: "'Avalon Developers List'" Subject: RE: [Avalon5] Startable interface Date: Fri, 7 Jun 2002 16:39:40 -0400 Message-ID: <008101c20e63$7272c2f0$ac00a8c0@Gabriel> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2627 In-Reply-To: <028801c20e61$03fddaa0$c92d0a3e@PC103> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > From: Nicola Ken Barozzi [mailto:nicolaken@apache.org] > > From: "Berin Loritsch" > > > It seems that Peter already beat me putting a proposal Avalon 5 > > directory out there. Quick question regarding the Startable > > interface: > > > > public interface Startable > > { > > void start() throws Exception; > > void stop() throws Exception; > > } > > > > Is there any particular reason that start() and stop() require > > exception throwing? Wouldn't RuntimeExceptions (reported in the > > javadocs so they are documented) be better? > > Why? > I hate RuntimeExceptions, and they have been a source of > really uncomprehensible error reporting in Cocoon. Could you > please explain? It's either that or not allow exceptions on either. Now, on initialization, I can understand exception throwing because we have to not let the component be available to other components. If the component is not stable because it couldn't allocate thread resources that it needs, that is an Exception. However, on the stop() method, it really isn't helpful. We are getting rid of the component at this stage--so why should we care if it can't get rid of the thread it wanted. We can force everything to shut down hard if necessary. > > Also, I thought that we were in favor of separating > Intializable and > > Disposable. They aren't as tightly coupled as start()/stop() or > > suspend()/resume(). Otherwise, there will be a lot of > components with > > either an empty initialize() or an empty dispose() method. > > +-0 > > The same thing happened with my classes for startable, since > 80% of the time I just start components. ? :/ Let me ask you something. If your component starts a thread that has to run for the duration of the component's life, then how do you release that reasource? If your answer is the dispose() method, then it is a misuse. Now, if you start up a thread that only needs to run to completion, that is another thing entirely. The concept behind the Startable interface is an active component that has a thread running in the background at all times, until it is stop()ed. -- To unsubscribe, e-mail: For additional commands, e-mail: