Return-Path: Delivered-To: apmail-cocoon-cvs-archive@www.apache.org Received: (qmail 73766 invoked from network); 6 May 2004 17:24:19 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 6 May 2004 17:24:19 -0000 Received: (qmail 49267 invoked by uid 500); 6 May 2004 17:24:09 -0000 Delivered-To: apmail-cocoon-cvs-archive@cocoon.apache.org Received: (qmail 49210 invoked by uid 500); 6 May 2004 17:24:08 -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: Delivered-To: mailing list cvs@cocoon.apache.org Received: (qmail 49173 invoked by uid 500); 6 May 2004 17:24:08 -0000 Delivered-To: apmail-cocoon-2.1-cvs@apache.org Received: (qmail 49135 invoked from network); 6 May 2004 17:24:08 -0000 Received: from unknown (HELO minotaur.apache.org) (209.237.227.194) by daedalus.apache.org with SMTP; 6 May 2004 17:24:08 -0000 Received: (qmail 43181 invoked by uid 1260); 6 May 2004 08:24:13 -0000 Date: 6 May 2004 08:24:13 -0000 Message-ID: <20040506082413.43180.qmail@minotaur.apache.org> From: cziegeler@apache.org To: cocoon-2.1-cvs@apache.org Subject: cvs commit: cocoon-2.1/src/blocks/slide/java/org/apache/cocoon/components/source/impl SlideSourceFactory.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N cziegeler 2004/05/06 01:24:13 Modified: src/blocks/slide/java/org/apache/cocoon/components/source/impl SlideSourceFactory.java Log: Lazy lookup to avoid duplicate lookup Revision Changes Path 1.16 +9 -2 cocoon-2.1/src/blocks/slide/java/org/apache/cocoon/components/source/impl/SlideSourceFactory.java Index: SlideSourceFactory.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/slide/java/org/apache/cocoon/components/source/impl/SlideSourceFactory.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -r1.15 -r1.16 --- SlideSourceFactory.java 27 Mar 2004 22:25:10 -0000 1.15 +++ SlideSourceFactory.java 6 May 2004 08:24:13 -0000 1.16 @@ -66,7 +66,6 @@ * @param manager ServiceManager. */ public void service(ServiceManager manager) throws ServiceException { - m_repository = (SlideRepository) manager.lookup(SlideRepository.ROLE); m_manager = manager; } @@ -82,6 +81,14 @@ public Source getSource(String location, Map parameters) throws MalformedURLException, IOException, SourceException { + if ( m_repository == null ) { + try { + m_repository = (SlideRepository) m_manager.lookup(SlideRepository.ROLE); + } catch (ServiceException se) { + throw new SourceException("Unable to lookup repository.", se); + } + } + if (getLogger().isDebugEnabled()) { getLogger().debug("Creating source object for " + location); }