Return-Path: Delivered-To: apmail-avalon-dev-archive@avalon.apache.org Received: (qmail 97607 invoked by uid 500); 12 May 2003 14:45:20 -0000 Mailing-List: contact dev-help@avalon.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 dev@avalon.apache.org Received: (qmail 97551 invoked from network); 12 May 2003 14:45:19 -0000 Received: from smtp02.myhosting.com (168.144.68.182) by daedalus.apache.org with SMTP; 12 May 2003 14:45:19 -0000 Received: from Lagrange ([80.252.165.122]) by smtp02.myhosting.com (Merak 5.5.7) with SMTP id KIC74160 for ; Mon, 12 May 2003 10:45:25 -0400 From: "Leo Sutic" To: "'Avalon Developers List'" Subject: RE: [RT (was: OT)] .Net better than Java in some ways Date: Mon, 12 May 2003 16:49:44 +0200 Message-ID: <000e01c31895$c3380cd0$0801a8c0@Lagrange> 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: X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Importance: Normal X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N > From: news [mailto:news@main.gmane.org] On Behalf Of Leo Simons > > ah....yes! In the meantime, consider: > > void service( ServiceManager manager ) > { > m_manager = manager; > // ... > m_comp = ServiceUtil.get( MyComponent.ROLE, m_manager ); > m_comp2 = ServiceUtil.get( MyOtherComponent.ROLE, m_manager ); > } > void dispose() > { > ServiceUtil.release( m_comp, m_manager ); > ServiceUtil.release( m_comp2, m_manager ); > } > > for encapsulating the try/catch :D Not quite: 1. m_comp = ServiceUtil.get( MyComponent.ROLE, m_manager ); You need a cast here: m_comp = (MyComponent) ServiceUtil.get( MyComponent.ROLE, m_manager ); 2. This does not work on a per-request basis. I.e. when you are looking up components and expect to release them before the client itself is disposed. I found JJTree & JavaCC which seems like the tools to use for this kind of processing. /LS --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@avalon.apache.org For additional commands, e-mail: dev-help@avalon.apache.org