Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 95619 invoked from network); 29 May 2006 16:56:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 29 May 2006 16:56:23 -0000 Received: (qmail 22367 invoked by uid 500); 29 May 2006 16:56:23 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 22235 invoked by uid 500); 29 May 2006 16:56:22 -0000 Mailing-List: contact cvs-help@cocoon.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@cocoon.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 22224 invoked by uid 99); 29 May 2006 16:56:22 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 May 2006 09:56:22 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 May 2006 09:56:22 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id D3D091A983A; Mon, 29 May 2006 09:56:01 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r410118 - in /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring: AvalonServiceManager.java AvalonServiceSelector.java Date: Mon, 29 May 2006 16:56:01 -0000 To: cvs@cocoon.apache.org From: cziegeler@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060529165601.D3D091A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: cziegeler Date: Mon May 29 09:56:00 2006 New Revision: 410118 URL: http://svn.apache.org/viewvc?rev=410118&view=rev Log: Wrap Spring exceptions in ServiceExceptions Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceManager.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceManager.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceManager.java?rev=410118&r1=410117&r2=410118&view=diff ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceManager.java (original) +++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceManager.java Mon May 29 09:56:00 2006 @@ -52,7 +52,12 @@ throw new ServiceException("AvalonServiceManager", "Component with '" + role + "' is not defined in this service manager."); } - return this.beanFactory.getBean(role); + try { + return this.beanFactory.getBean(role); + } catch (BeansException be) { + throw new ServiceException("AvalonServiceManager", + "Exception during lookup of component with '" + role + "'.", be); + } } /** Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java?rev=410118&r1=410117&r2=410118&view=diff ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java (original) +++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/core/container/spring/AvalonServiceSelector.java Mon May 29 09:56:00 2006 @@ -56,7 +56,16 @@ if ( key == null || key.toString().length() == 0 ) { key = this.defaultKey; } - return this.beanFactory.getBean(this.role + key); + if ( !this.isSelectable(key) ) { + throw new ServiceException("AvalonServiceSelector", + "Component with role '" + this.role + "' and key '" + key + "' is not defined in this service selector."); + } + try { + return this.beanFactory.getBean(this.role + key); + } catch (BeansException be) { + throw new ServiceException("AvalonServiceSelector", + "Exception during lookup of component with role '" + this.role + "' and key '" + key + "'.", be); + } } /**