From stephanie60@example.com Mon Apr 02 06:56:22 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 81662 invoked from network); 2 Apr 2007 06:56:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2007 06:56:20 -0000 Received: (qmail 17471 invoked by uid 500); 2 Apr 2007 06:56:27 -0000 Delivered-To: stephanie60@example.com Received: (qmail 17403 invoked by uid 500); 2 Apr 2007 06:56:26 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 17392 invoked by uid 99); 2 Apr 2007 06:56:26 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2007 23:56:26 -0700 X-ASF-Spam-Status: No, hits=-98.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Apr 2007 23:56:18 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 4E8441A9838; Sun, 1 Apr 2007 23:55:58 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r524734 - in /cocoon/trunk/commons/bylaws: ./ bylaws.txt Date: Mon, 02 Apr 2007 06:55:57 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Sun Apr 1 23:55:50 2007 New Revision: 524734 URL: http://svn.apache.org/viewvc?view=rev&rev=524734 Log: some ideas what should go into more specific Bylaws than we have today Added: cocoon/trunk/commons/bylaws/ cocoon/trunk/commons/bylaws/bylaws.txt (with props) Added: cocoon/trunk/commons/bylaws/bylaws.txt URL: http://svn.apache.org/viewvc/cocoon/trunk/commons/bylaws/bylaws.txt?view=auto&rev=524734 ============================================================================== --- cocoon/trunk/commons/bylaws/bylaws.txt (added) +++ cocoon/trunk/commons/bylaws/bylaws.txt Sun Apr 1 23:55:50 2007 @@ -0,0 +1,64 @@ +(Note: This is a summary of ideas about what could/should be part of our bylaws some time in the future. +Of course a vote is required to make them official.) + +BYLAWS +******************************************************************************** + +MISSION + - XML pipelines (narrow sense) + - web application framework (broader sense) + +ROLES AND RESPONSIBILITIES + - see http://www.apache.org/foundation/how-it-works.html + - each Cocoon committer is invited to join the PMC membership. There is NO vote required. + - each committer/PMC member can request to change into an emeritus status. coming back does NOT require a further vote + sending a message to stephanie60@example.com is enough + +GIVING CREDIT TO CONTRIBUTORS + - http://marc.info/?l=xml-cocoon-dev&m=117394069331060&w=2 + - non committers: changes docs + +RELEASING + - procedure + - formal technical requirements (binaries, sources, javadocs, checksums, gpg singed, license, license header) + +STATUS + - each project has a changes.xml + * detailed log about what has changed + * give credit to contributors + +COMMIT RIGHTS + - (of course) all Cocoon committers + - additionally all Excalibur, Forrest and Lenya committers too + - Cocoon committers have commit rights for: Forrest, Lenya + +VERSIONING + - meaning of major, minor, patch level + - block compatibility + - library upgrades + +SUB PROJECTS AND BLOCKS + - what is a sub project + - what's the difference of a block and a sub project + - voting rules for setting up sub projects + +VOTING + - committer votings: consensus, at least three +1 + - release votings: majority, at least three +1 + - vetoes + - a vote has to stay open for at least 72 hours + - votes have to be done in public. The only exception is security issues. + + -> copying what Ant/Forrest developed? + + Questions: + - What happens in the case of three +3 and two -1? Is this enough for + - What happens in the case of a tie? (chair decision?) + + +COMMUNICATION + - purpose of dev/users/private/doc/commits + +REPORTING + - PMC chair drafts the report and sends it to private@, 48 hours for review before + sending it to the board \ No newline at end of file Propchange: cocoon/trunk/commons/bylaws/bylaws.txt ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/trunk/commons/bylaws/bylaws.txt ------------------------------------------------------------------------------ svn:keywords = Id Propchange: cocoon/trunk/commons/bylaws/bylaws.txt ------------------------------------------------------------------------------ svn:mime-type = text/plain From stephanie60@example.com Mon Apr 02 19:27:25 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 74901 invoked from network); 2 Apr 2007 19:27:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2007 19:27:23 -0000 Received: (qmail 54433 invoked by uid 500); 2 Apr 2007 19:27:30 -0000 Delivered-To: stephanie60@example.com Received: (qmail 54286 invoked by uid 500); 2 Apr 2007 19:27:29 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 54265 invoked by uid 99); 2 Apr 2007 19:27:29 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 12:27:29 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 12:27:21 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id D28551A9838; Mon, 2 Apr 2007 12:27:01 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r524892 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachedSourceResponse.java Date: Mon, 02 Apr 2007 19:27:01 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Mon Apr 2 12:27:01 2007 New Revision: 524892 URL: http://svn.apache.org/viewvc?view=rev&rev=524892 Log: move CachingSource to core (only one class to check if revision history is preserved) Added: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachedSourceResponse.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachedSourceResponse.java From stephanie60@example.com Mon Apr 02 19:29:56 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 76236 invoked from network); 2 Apr 2007 19:29:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2007 19:29:52 -0000 Received: (qmail 57349 invoked by uid 500); 2 Apr 2007 19:29:59 -0000 Delivered-To: stephanie60@example.com Received: (qmail 57290 invoked by uid 500); 2 Apr 2007 19:29:59 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 57279 invoked by uid 99); 2 Apr 2007 19:29:59 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 12:29:59 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 12:29:51 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 5F71C1A983E; Mon, 2 Apr 2007 12:29:31 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r524896 - in /cocoon/trunk/core/cocoon-core/src: main/java/org/apache/cocoon/components/source/ main/java/org/apache/cocoon/components/source/helpers/ main/java/org/apache/cocoon/components/source/impl/ test/java/org/apache/cocoon/component... Date: Mon, 02 Apr 2007 19:29:28 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Mon Apr 2 12:29:27 2007 New Revision: 524896 URL: http://svn.apache.org/viewvc?view=rev&rev=524896 Log: move CachingSource to core Added: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/InspectableSource.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/InspectableSource.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/helpers/DelaySourceRefresher.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/helpers/DelaySourceRefresher.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/helpers/SourceProperty.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/helpers/SourceProperty.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/helpers/SourceRefresher.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/helpers/SourceRefresher.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSource.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachingSource.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java - copied, changed from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceValidityStrategy.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceValidityStrategy.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/ExpiresCachingSourceValidityStrategy.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/ExpiresCachingSourceValidityStrategy.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/TraversableCachingSource.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/TraversableCachingSource.java cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/XMLizableSource.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/java/org/apache/cocoon/components/source/impl/XMLizableSource.java cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/XMLizableSourceFactory.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/java/org/apache/cocoon/components/source/impl/XMLizableSourceFactory.java cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.spring.xml - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.spring.xml cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.xtest - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.xtest cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/cachingsourcetest.xml - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/resources/org/apache/cocoon/components/source/impl/cachingsourcetest.xml Copied: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java (from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java) URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java?view=diff&rev=524896&p1=cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java&r1=524887&p2=cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java&r2=524896 ============================================================================== --- cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java (original) +++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java Mon Apr 2 12:29:27 2007 @@ -32,6 +32,9 @@ import org.apache.avalon.framework.service.ServiceManager; import org.apache.avalon.framework.service.Serviceable; import org.apache.avalon.framework.thread.ThreadSafe; +import org.apache.cocoon.caching.Cache; +import org.apache.cocoon.components.source.InspectableSource; +import org.apache.cocoon.components.source.helpers.SourceRefresher; import org.apache.excalibur.source.Source; import org.apache.excalibur.source.SourceException; import org.apache.excalibur.source.SourceFactory; @@ -40,10 +43,6 @@ import org.apache.excalibur.source.SourceUtil; import org.apache.excalibur.source.TraversableSource; import org.apache.excalibur.source.URIAbsolutizer; - -import org.apache.cocoon.caching.Cache; -import org.apache.cocoon.components.source.InspectableSource; -import org.apache.cocoon.components.source.helpers.SourceRefresher; /** * This class implements a proxy like source caches the contents of the source From stephanie60@example.com Mon Apr 02 19:31:08 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 77647 invoked from network); 2 Apr 2007 19:31:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2007 19:31:07 -0000 Received: (qmail 58998 invoked by uid 500); 2 Apr 2007 19:31:14 -0000 Delivered-To: stephanie60@example.com Received: (qmail 58923 invoked by uid 500); 2 Apr 2007 19:31:13 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 58912 invoked by uid 99); 2 Apr 2007 19:31:13 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 12:31:13 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 12:31:06 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 043CD1A983A; Mon, 2 Apr 2007 12:30:46 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r524898 - in /cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src: main/java/org/apache/cocoon/components/source/ main/java/org/apache/cocoon/components/source/helpers/ main/java/org/apache/cocoon/components/source/impl/ test/r... Date: Mon, 02 Apr 2007 19:30:45 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Mon Apr 2 12:30:44 2007 New Revision: 524898 URL: http://svn.apache.org/viewvc?view=rev&rev=524898 Log: move CachingSource to core Removed: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/InspectableSource.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/helpers/DelaySourceRefresher.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/helpers/SourceProperty.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/helpers/SourceRefresher.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachedSourceResponse.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachingSource.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceValidityStrategy.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/ExpiresCachingSourceValidityStrategy.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/TraversableCachingSource.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.spring.xml cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.xtest cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/resources/org/apache/cocoon/components/source/impl/cachingsourcetest.xml From stephanie60@example.com Mon Apr 02 19:35:34 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 79342 invoked from network); 2 Apr 2007 19:35:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Apr 2007 19:35:32 -0000 Received: (qmail 62900 invoked by uid 500); 2 Apr 2007 19:35:39 -0000 Delivered-To: stephanie60@example.com Received: (qmail 62776 invoked by uid 500); 2 Apr 2007 19:35:39 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 62757 invoked by uid 99); 2 Apr 2007 19:35:39 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 12:35:39 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Apr 2007 12:35:31 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 555AE1A9838; Mon, 2 Apr 2007 12:35:11 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r524900 - in /cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test: java/org/ resources/org/ Date: Mon, 02 Apr 2007 19:35:11 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Mon Apr 2 12:35:10 2007 New Revision: 524900 URL: http://svn.apache.org/viewvc?view=rev&rev=524900 Log: move CachingSource to core Removed: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/java/org/ cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/test/resources/org/ From stephanie60@example.com Tue Apr 03 08:11:16 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 62274 invoked from network); 3 Apr 2007 08:11:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Apr 2007 08:11:13 -0000 Received: (qmail 7313 invoked by uid 500); 3 Apr 2007 08:11:20 -0000 Delivered-To: stephanie60@example.com Received: (qmail 7176 invoked by uid 500); 3 Apr 2007 08:11:19 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 7165 invoked by uid 99); 3 Apr 2007 08:11:19 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:11:19 -0700 X-ASF-Spam-Status: No, hits=-98.6 required=10.0 tests=ALL_TRUSTED,INFO_TLD,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:11:10 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 84C0C1A9838; Tue, 3 Apr 2007 01:10:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r525076 - in /cocoon/trunk/core/cocoon-core/src: main/java/org/apache/cocoon/components/source/ main/java/org/apache/cocoon/components/source/helpers/ main/java/org/apache/cocoon/components/source/impl/ main/resources/META-INF/cocoon/spring... Date: Tue, 03 Apr 2007 08:10:49 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Tue Apr 3 01:10:48 2007 New Revision: 525076 URL: http://svn.apache.org/viewvc?view=rev&rev=525076 Log: - Avalon->Spring - provide an abstract bean definition that can be used by any custom bean definition of caching sources - move dependency on InspectableSource to repository-impl (where it was before but as I refactored incrementally, it was easier to move things around) - all unit tests pass but the coverage of the refresher goes to 0 so I'm not sure if everything still works as expected - the refresher is setup via Spring too. This has the disadvantage that an "inline configuration" (-> within the bean definition) can't be provided anymore - javadocs still need to reflect my latest changes Added: cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml (with props) Removed: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/InspectableSource.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/helpers/DelaySourceRefresher.java cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.spring.xml cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.xtest Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/helpers/DelaySourceRefresher.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/helpers/DelaySourceRefresher.java?view=diff&rev=525076&r1=525075&r2=525076 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/helpers/DelaySourceRefresher.java (original) +++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/helpers/DelaySourceRefresher.java Tue Apr 3 01:10:48 2007 @@ -30,24 +30,15 @@ import org.apache.avalon.framework.CascadingException; import org.apache.avalon.framework.CascadingRuntimeException; -import org.apache.avalon.framework.activity.Disposable; -import org.apache.avalon.framework.configuration.Configurable; import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.configuration.SAXConfigurationHandler; import org.apache.avalon.framework.context.Context; import org.apache.avalon.framework.context.ContextException; -import org.apache.avalon.framework.context.Contextualizable; import org.apache.avalon.framework.logger.AbstractLogEnabled; import org.apache.avalon.framework.parameters.Parameters; import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; -import org.apache.avalon.framework.service.Serviceable; -import org.apache.avalon.framework.thread.ThreadSafe; -import org.apache.excalibur.source.Source; -import org.apache.excalibur.source.SourceException; -import org.apache.excalibur.source.SourceResolver; - import org.apache.cocoon.Constants; import org.apache.cocoon.ProcessingException; import org.apache.cocoon.Processor; @@ -57,6 +48,12 @@ import org.apache.cocoon.environment.background.BackgroundEnvironment; import org.apache.cocoon.environment.internal.EnvironmentHelper; import org.apache.cocoon.util.NetUtils; +import org.apache.cocoon.util.avalon.CLLoggerWrapper; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.excalibur.source.Source; +import org.apache.excalibur.source.SourceException; +import org.apache.excalibur.source.SourceResolver; /** * Default implementation of the refresher. @@ -64,33 +61,29 @@ * @since 2.1.1 * @version $Id$ */ -public class DelaySourceRefresher extends AbstractLogEnabled - implements Contextualizable, Serviceable, Configurable, - Disposable, ThreadSafe, SourceRefresher { - - private static final String PARAM_WRITE_FILE = "write-file"; +public class DelaySourceRefresher implements SourceRefresher { + private Log logger = LogFactory.getLog(getClass()); + + private static final long DEFAULT_INTERVAL = 0; + private static final String DEFAULT_WRITE_FILE = "refresher-targets.xml"; - private static final String TAGNAME_TARGET = "target"; private static final String ATTR_KEY = "key"; private static final String ATTR_URI = "uri"; private static final String ATTR_INTERVAL = "interval"; - protected Context context; - - // service dependencies - protected ServiceManager manager; protected SourceResolver resolver; protected RunnableManager runnable; + protected ServiceManager manager; + protected Settings settings; + protected long writeInterval = DEFAULT_INTERVAL; + protected String fileName = DEFAULT_WRITE_FILE; // the scheduled targets to be persisted and recovered upon restart protected Map entries = Collections.synchronizedMap(new HashMap()); - // the cocoon working directory - protected File workDir; - /** The source to persist refresher entries into */ protected File configFile; @@ -99,32 +92,11 @@ protected ConfigurationTask configurationTask; - - // ---------------------------------------------------- Lifecycle - - /* (non-Javadoc) - * @see Contextualizable#contextualize(Context) - */ - public void contextualize(Context context) throws ContextException { - this.context = context; - } - - /* (non-Javadoc) - * @see Serviceable#service(ServiceManager) - */ - public void service(ServiceManager manager) throws ServiceException { - this.manager = manager; - this.resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE); - this.runnable = (RunnableManager) this.manager.lookup(RunnableManager.ROLE); - this.workDir = new File(((Settings)this.manager.lookup(Settings.ROLE)).getWorkDirectory()); - } - - public void configure(Configuration configuration) throws ConfigurationException { - Parameters parameters = Parameters.fromConfiguration(configuration); - long interval = parameters.getParameterAsLong("interval", 0); - if (interval > 0) { - String fileName = parameters.getParameter(PARAM_WRITE_FILE, DEFAULT_WRITE_FILE); - this.configFile = new File(this.workDir, fileName); + public void init() throws ConfigurationException { + + if (writeInterval > 0) { + File workDir = new File(this.settings.getWorkDirectory()); + this.configFile = new File(workDir, fileName); if (this.configFile.exists() && !this.configFile.canWrite()) { throw new ConfigurationException("Parameter 'write-source' resolves to not modifiable file: " + this.configFile); @@ -133,36 +105,23 @@ throw new ConfigurationException("Can not create parent directory for: " + this.configFile); } - if (getLogger().isDebugEnabled()) { - getLogger().debug("Write source location: " + this.configFile); + if (logger.isDebugEnabled()) { + logger.debug("Write source location: " + this.configFile); } setupRefreshJobs(readRefreshJobConfiguration()); - startConfigurationTask(interval); + startConfigurationTask(writeInterval); } else { - if (getLogger().isInfoEnabled()) { - getLogger().info("Not writing update targets to file."); + if (logger.isInfoEnabled()) { + logger.info("Not writing update targets to file."); } } - - // Setup any in-line configured tasks - setupRefreshJobs(configuration); + } - /* (non-Javadoc) - * @see Disposable#dispose() - */ - public void dispose() { + + public void destroy() { stopConfigurationTask(); - if (this.runnable != null) { - this.manager.release(this.runnable); - this.runnable = null; - } - if (this.resolver != null) { - this.manager.release(this.resolver); - this.resolver = null; - } - this.manager = null; } // ---------------------------------------------------- SourceRefresher implementation @@ -187,7 +146,7 @@ if (task == null) { // New source added. task = new RefresherTask(key, uri, interval); - task.enableLogging(getLogger()); + task.enableLogging(new CLLoggerWrapper(logger)); this.entries.put(key, task); this.runnable.execute(task, interval, interval); this.changed = true; @@ -225,7 +184,7 @@ SourceUtil.toSAX(this.manager, source, source.getMimeType(), b); } } catch (Exception ignore) { - getLogger().warn("Unable to read configuration from " + this.configFile); + logger.warn("Unable to read configuration from " + this.configFile); } finally { if (source != null) { this.resolver.release(source); @@ -246,8 +205,8 @@ try { setupSingleRefreshJob(children[i]); } catch (CascadingException ignore) { - if (getLogger().isDebugEnabled()) { - getLogger().debug("Setting up refresh job, ignoring exception:", ignore); + if (logger.isDebugEnabled()) { + logger.debug("Setting up refresh job, ignoring exception:", ignore); } } } @@ -275,7 +234,7 @@ */ protected void startConfigurationTask(long interval) { configurationTask = new ConfigurationTask(); - configurationTask.enableLogging(getLogger()); + configurationTask.enableLogging(new CLLoggerWrapper(logger)); runnable.execute(configurationTask, interval, interval); } @@ -320,8 +279,8 @@ // Got I/O exception while writing the list. // Will re-try writing the list next time. success = false; - if (getLogger().isDebugEnabled()) { - getLogger().debug("Error writing targets to file.", e); + if (logger.isDebugEnabled()) { + logger.debug("Error writing targets to file.", e); } } finally { if (writer != null) { @@ -354,8 +313,8 @@ public void run() { if (this.uri != null) { - if (getLogger().isDebugEnabled()) { - getLogger().debug("Refreshing " + this.uri); + if (logger.isDebugEnabled()) { + logger.debug("Refreshing " + this.uri); } // Setup Environment @@ -363,7 +322,7 @@ try { org.apache.cocoon.environment.Context ctx = (org.apache.cocoon.environment.Context) context.get(Constants.CONTEXT_ENVIRONMENT_CONTEXT); - env = new BackgroundEnvironment(getLogger(), ctx); + env = new BackgroundEnvironment(new CLLoggerWrapper(logger), ctx); } catch (ContextException e) { throw new CascadingRuntimeException("No context found", e); } @@ -387,7 +346,7 @@ source = resolver.resolveURI(uri); source.refresh(); } catch (IOException e) { - getLogger().error("Error refreshing source", e); + logger.error("Error refreshing source", e); } finally { if (source != null) { resolver.release(source); @@ -425,4 +384,36 @@ return s.toString(); } } + + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ set dependencies ~~~~~ + + public void setServiceManager(ServiceManager manager) { + this.manager = manager; + } + + public void setSourceResolver(SourceResolver resolver) { + this.resolver = resolver; + } + + public void setRunnableManager(RunnableManager runnable) { + this.runnable = runnable; + } + + public void setSettings(Settings settings) { + this.settings = settings; + } + + public void setWriteFile(String fileName) { + this.fileName = fileName; + } + + public void setWriteInterval(long interval) { + this.writeInterval = interval; + } + + public void setAvalonContext(Context context) { + this.context = context; + } + + } Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java?view=diff&rev=525076&r1=525075&r2=525076 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java (original) +++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java Tue Apr 3 01:10:48 2007 @@ -21,20 +21,15 @@ import java.util.Iterator; import java.util.Map; -import org.apache.avalon.framework.activity.Disposable; -import org.apache.avalon.framework.configuration.Configurable; -import org.apache.avalon.framework.configuration.Configuration; -import org.apache.avalon.framework.configuration.ConfigurationException; import org.apache.avalon.framework.container.ContainerUtil; -import org.apache.avalon.framework.logger.AbstractLogEnabled; import org.apache.avalon.framework.parameters.Parameters; import org.apache.avalon.framework.service.ServiceException; import org.apache.avalon.framework.service.ServiceManager; -import org.apache.avalon.framework.service.Serviceable; -import org.apache.avalon.framework.thread.ThreadSafe; import org.apache.cocoon.caching.Cache; -import org.apache.cocoon.components.source.InspectableSource; import org.apache.cocoon.components.source.helpers.SourceRefresher; +import org.apache.cocoon.util.avalon.CLLoggerWrapper; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.apache.excalibur.source.Source; import org.apache.excalibur.source.SourceException; import org.apache.excalibur.source.SourceFactory; @@ -121,176 +116,41 @@ * @version $Id$ * @since 2.1.1 */ -public class CachingSourceFactory extends AbstractLogEnabled - implements Serviceable, Configurable, Disposable, - ThreadSafe, URIAbsolutizer, SourceFactory { - - // ---------------------------------------------------- Constants - - private static final String ASYNC_PARAM = "async"; - private static final String EVENT_AWARE_PARAM = "event-aware"; - private static final String CACHE_ROLE_PARAM = "cache-role"; - private static final String REFRESHER_ROLE_PARAM = "refresher-role"; - private static final String DEFAULT_EXPIRES_PARAM = "default-expires"; - private static final String DEFAULT_VALIDITY_STRATEGY = ExpiresCachingSourceValidityStrategy.class.getName(); +public class CachingSourceFactory implements URIAbsolutizer, SourceFactory { - // ---------------------------------------------------- Instance variables + private Log logger = LogFactory.getLog(getClass()); + + private static final boolean DEFAULT_ASYNC_VALUE = false; + + private static final int DEFAULT_EXPIRES_VALUE = -1; /** Protocol prefix / factory name */ - private String scheme; + protected String scheme; /** Asynchronous ? */ - private boolean async; + protected boolean async = DEFAULT_ASYNC_VALUE; + + protected int defaultExpires = DEFAULT_EXPIRES_VALUE; - /** Event aware ? */ - private boolean eventAware; + /** Validity strategy implementation*/ + protected CachingSourceValidityStrategy validityStrategy; + + /** The cache */ + protected Cache cache; - /** Validity strategy implementation: class name */ - private String validityStrategyClassName = DEFAULT_VALIDITY_STRATEGY; + /** The refresher */ + protected SourceRefresher refresher; - /** Validity strategy implementation: class name */ - private CachingSourceValidityStrategy validityStrategy; + /** The Cocoon service manager */ + protected ServiceManager serviceManager; - /** The role of the cache */ - private String cacheRole; - - /** The role of the refresher */ - private String refresherRole; - - /** Default expires value */ - private int defaultExpires; - - /** Has the lazy initialization been done? */ - private volatile boolean isInitialized; - - /** The <code>ServiceManager</code> */ - protected ServiceManager manager; - /** The {@link SourceResolver} */ protected SourceResolver resolver; - - /** The refresher */ - protected SourceRefresher refresher; - - /** The cache */ - protected Cache cache; - - // ---------------------------------------------------- Lifecycle - + + public CachingSourceFactory() { } - - public void service(ServiceManager manager) { - this.manager = manager; - // Due to cyclic dependencies we can't lookup the resolver, - // the refresher or the cache until after the factory is - // initialized. - } - - public void configure(Configuration configuration) throws ConfigurationException { - this.scheme = configuration.getAttribute("name"); - Parameters parameters = Parameters.fromConfiguration(configuration); - - // 'async' parameter - this.async = parameters.getParameterAsBoolean(ASYNC_PARAM, false); - - // 'event-aware' parameter - this.eventAware = parameters.getParameterAsBoolean(EVENT_AWARE_PARAM, false); - - if(this.eventAware == true) { - this.validityStrategyClassName = - "org.apache.cocoon.components.source.impl.EventAwareCachingSourceValidityStrategy"; - } - try { - this.validityStrategy = (CachingSourceValidityStrategy) - getClass().getClassLoader().loadClass(this.validityStrategyClassName).newInstance(); - } catch(Exception cce) { - throw new ConfigurationException("Can't create class for '" + - this.validityStrategyClassName + "'.", cce); - } - - // 'cache-role' parameter - this.cacheRole = parameters.getParameter(CACHE_ROLE_PARAM, Cache.ROLE); - - // 'refresher-role' parameter - if (this.async) { - this.refresherRole = parameters.getParameter(REFRESHER_ROLE_PARAM, SourceRefresher.ROLE); - } - - this.defaultExpires = parameters.getParameterAsInteger(DEFAULT_EXPIRES_PARAM, -1); - - if (getLogger().isDebugEnabled()) { - getLogger().debug("Using cache " + this.cacheRole); - if (this.async) { - getLogger().debug("Using refresher " + this.refresherRole); - } - } - } - - /** - * Lazy initialization of resolver and refresher because of - * cyclic dependencies. - * - * @throws SourceException - */ - private synchronized void lazyInitialize() throws SourceException { - if (this.isInitialized) { - // another thread finished initialization for us while - // we were waiting - return; - } - - try { - this.resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE); - } catch (ServiceException se) { - throw new SourceException("Missing service dependency: " + SourceResolver.ROLE, se); - } - - try { - this.cache = (Cache) this.manager.lookup(this.cacheRole); - } catch (ServiceException se) { - throw new SourceException("Missing service dependency: " + this.cacheRole, se); - } - - if (this.async) { - try { - this.refresher = (SourceRefresher) this.manager.lookup(this.refresherRole); - } catch (ServiceException se) { - throw new SourceException("Missing service dependency: " + this.refresherRole, se); - } - } - - this.isInitialized = true; - } - - /* (non-Javadoc) - * @see Disposable#dispose() - */ - public void dispose() { - if (this.refresher != null) { - this.manager.release(this.refresher); - this.refresher = null; - } - if (this.cache != null) { - this.manager.release(this.cache); - this.cache = null; - } - if (this.resolver != null) { - this.manager.release(this.resolver); - this.resolver = null; - } - this.manager = null; - } - - // ---------------------------------------------------- SourceFactory implementation - - protected String getScheme() { - return this.scheme; - } - - protected boolean isAsync() { - return this.async; - } + /** * Get a <code>Source</code> object. @@ -299,13 +159,8 @@ public Source getSource(final String location, final Map parameters) throws MalformedURLException, IOException { - if (getLogger().isDebugEnabled() ) { - getLogger().debug("Creating source " + location); - } - - // we must do lazy initialization because of cyclic dependencies - if (!this.isInitialized) { - lazyInitialize(); + if (logger.isDebugEnabled() ) { + logger.debug("Creating source " + location); } // snip the cache protocol @@ -343,12 +198,11 @@ } } - int expires = params.getParameterAsInteger(CachingSource.CACHE_EXPIRES_PARAM, defaultExpires); - String cacheName = params.getParameter(CachingSource.CACHE_NAME_PARAM, null); + int expires = params.getParameterAsInteger(CachingSource.CACHE_EXPIRES_PARAM, this.defaultExpires); + String cacheName = params.getParameter(CachingSource.CACHE_NAME_PARAM, null); boolean fail = params.getParameterAsBoolean(CachingSource.CACHE_FAIL_PARAM, false); - Source source = this.resolver.resolveURI(uri); - return createCachingSource(location, uri, source, expires, cacheName, fail); + return createCachingSource(location, uri, this.resolver.resolveURI(uri), expires, cacheName, fail); } /** @@ -362,51 +216,21 @@ boolean fail) throws SourceException { - CachingSource source; - - if (wrappedSource instanceof TraversableSource) { - if (wrappedSource instanceof InspectableSource) { - source = new InspectableTraversableCachingSource(this, - getScheme(), - uri, - wrappedUri, - (InspectableSource) wrappedSource, - expires, - cacheName, - isAsync(), - this.validityStrategy, - fail); - } else { - source = new TraversableCachingSource(this, - getScheme(), - uri, - wrappedUri, - (TraversableSource) wrappedSource, - expires, - cacheName, - isAsync(), - this.validityStrategy, - fail); - } - } else { - source = new CachingSource(getScheme(), - uri, - wrappedUri, - wrappedSource, - expires, - cacheName, - isAsync(), - this.validityStrategy, - fail); - } + CachingSource source = instantiateSource( + uri, + wrappedUri, + wrappedSource, + expires, + cacheName, + fail); // set the required components directly for speed source.cache = this.cache; - ContainerUtil.enableLogging(source, getLogger()); + ContainerUtil.enableLogging(source, new CLLoggerWrapper(logger)); try { // call selected avalon lifecycle interfaces. Mmmh. - ContainerUtil.service(source, this.manager); + ContainerUtil.service(source, this.serviceManager); ContainerUtil.initialize(source); } catch (ServiceException e) { throw new SourceException("Unable to initialize source.", e); @@ -419,19 +243,54 @@ final Parameters params = new Parameters(); params.setParameter(SourceRefresher.PARAM_CACHE_INTERVAL, String.valueOf(source.getExpiration())); + if(this.refresher == null) { + String msg = "Make sure that the SourceRefresher is injected correctly when " + + "you want to use the source asyncronous and with an expires param > 0."; + logger.error(msg); + throw new SourceException(msg); + } this.refresher.refresh(source.getCacheKey(), source.getURI(), params); } return source; } + + protected CachingSource instantiateSource(String uri, String wrappedUri, Source wrappedSource, int expires, + String cacheName, boolean fail) { + + if (wrappedSource instanceof TraversableSource) { + return new TraversableCachingSource( + this, + this.scheme, + uri, + wrappedUri, + (TraversableSource) wrappedSource, + expires, + cacheName, + this.async, + this.validityStrategy, + fail); + } else { + return new CachingSource( + this.scheme, + uri, + wrappedUri, + wrappedSource, + expires, + cacheName, + this.async, + this.validityStrategy, + fail); + } + } /** * Release a {@link Source} object. */ public void release(Source source) { if (source instanceof CachingSource) { - if (getLogger().isDebugEnabled() ) { - getLogger().debug("Releasing source " + source.getURI()); + if (logger.isDebugEnabled() ) { + logger.debug("Releasing source " + source.getURI()); } CachingSource caching = (CachingSource) source; resolver.release(caching.source); @@ -439,14 +298,53 @@ } } - // ---------------------------------------------------- URIAbsolutizer implementation + // ---------------------------------------------------- URIAbsolutizer + // implementation /* - * (non-Javadoc) - * @see org.apache.excalibur.source.URIAbsolutizer#absolutize(java.lang.String, java.lang.String) + * (non-Javadoc) + * + * @see org.apache.excalibur.source.URIAbsolutizer#absolutize(java.lang.String, + * java.lang.String) */ public String absolutize(String baseURI, String location) { return SourceUtil.absolutize(baseURI, location, true); } + // ---------------------------------------------------- Set dependencies + + public void setCache(Cache cache) { + this.cache = cache; + } + + public void setValidityStrategy(CachingSourceValidityStrategy validityStrategy) { + this.validityStrategy = validityStrategy; + } + + public void setServiceManager(ServiceManager serviceManager) { + this.serviceManager = serviceManager; + } + + public void setSourceResolver(SourceResolver resolver) { + this.resolver = resolver; + } + + public void setScheme(String scheme) { + this.scheme = scheme; + } + + // optional + + public void setSourceRefresher(SourceRefresher refresher) { + this.refresher = refresher; + } + + public void setAsync(boolean async) { + this.async = async; + } + + public void setDefaultExpires(int expires) { + this.defaultExpires = expires; + } + } Added: cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml?view=auto&rev=525076 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml (added) +++ cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml Tue Apr 3 01:10:48 2007 @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + Licensed to the Apache Software Foundation (ASF) under one or more + contributor license agreements. See the NOTICE file distributed with + this work for additional information regarding copyright ownership. + The ASF licenses this file to You under the Apache License, Version 2.0 + (the "License"); you may not use this file except in compliance with + the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +--> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:p="http://www.springframework.org/schema/p" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> + + <!--+ + | An abstract CachingSource bean definition providing correct dependencies for most + | usage scenarios. This avoid code duplication. + +--> + <bean name="org.apache.excalibur.source.SourceFactory/caching888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stract" + class="org.apache.cocoon.components.source.impl.CachingSourceFactory" + abstract="true"> + <property name="cache" ref="org.apache.cocoon.caching.Cache"/> + <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/> + <property name="serviceManager" ref="org.apache.avalon.framework.service.ServiceManager"/> + <property name="validityStrategy"> + <bean class="org.apache.cocoon.components.source.impl.ExpiresCachingSourceValidityStrategy"/> + </property> + </bean> + + <bean name="org.apache.excalibur.source.SourceFactory/caching" + class="org.apache.cocoon.components.source.impl.CachingSourceFactory" + parent="org.apache.excalibur.source.SourceFactory/caching888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stract" + p:scheme="caching"/> + + <bean name="org.apache.cocoon.components.source.helpers.DelaySourceRefresher" + class="org.apache.cocoon.components.source.helpers.DelaySourceRefresher" + init-method="init" + destroy-method="destroy"> + <property name="sourceResolver" ref="org.apache.excalibur.source.SourceResolver"/> + <property name="serviceManager" ref="org.apache.avalon.framework.service.ServiceManager"/> + <property name="settings" ref="org.apache.cocoon.configuration.Settings"/> + <property name="runnableManager" ref="org.apache.cocoon.components.thread.RunnableManager"/> + <property name="avalonContext" ref="org.apache.avalon.framework.context.Context"/> + </bean> + + <bean name="org.apache.excalibur.source.SourceFactory/async-caching" + class="org.apache.cocoon.components.source.impl.CachingSourceFactory" + parent="org.apache.excalibur.source.SourceFactory/caching888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stract" + p:scheme="async-caching" + p:async="true"> + <property name="sourceRefresher" ref="org.apache.cocoon.components.source.helpers.DelaySourceRefresher"/> + </bean> + +</beans> \ No newline at end of file Propchange: cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml ------------------------------------------------------------------------------ svn:keywords = Id Propchange: cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java?view=diff&rev=525076&r1=525075&r2=525076 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java (original) +++ cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java Tue Apr 3 01:10:48 2007 @@ -22,7 +22,7 @@ import org.apache.avalon.framework.context.DefaultContext; import org.apache.cocoon.Constants; -import org.apache.cocoon.core.container.ContainerTestCase; +import org.apache.cocoon.SitemapComponentTestCase; import org.apache.cocoon.environment.mock.MockContext; import org.apache.cocoon.xml.LoggingContentHandler; import org.apache.cocoon.xml.SaxBuffer; @@ -32,13 +32,13 @@ /** * TODO describe class */ -public class CachingSourceTestCase extends ContainerTestCase { +public class CachingSourceTestCase extends SitemapComponentTestCase { private static final String URI = "resource://org/apache/cocoon/components/source/impl/cachingsourcetest.xml?foo=bar"; SourceResolver resolver; - protected void setUp() throws Exception { + public void setUp() throws Exception { super.setUp(); resolver = (SourceResolver) lookup(SourceResolver.ROLE); } Modified: cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.spring.xml URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.spring.xml?view=diff&rev=525076&r1=525075&r2=525076 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.spring.xml (original) +++ cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.spring.xml Tue Apr 3 01:10:48 2007 @@ -1,7 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" - "http://www.springframework.org/dtd/spring-beans-2.0.dtd"> - <!-- +<!-- Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. @@ -17,10 +15,12 @@ See the License for the specific language governing permissions and limitations under the License. --> -<beans> - - <bean name="org.apache.cocoon.caching.Cache" class="org.apache.cocoon.caching.impl.CacheImpl"> - <property name="store" ref="org.apache.excalibur.store.Store"/> - </bean> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:p="http://www.springframework.org/schema/p" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> + <import resource="classpath:META-INF/cocoon/spring/cocoon-core-caching-source.xml"/> + <import resource="classpath:META-INF/cocoon/spring/cocoon-pipeline-impl-cache.xml"/> + </beans> Modified: cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.xtest URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.xtest?view=diff&rev=525076&r1=525075&r2=525076 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.xtest (original) +++ cocoon/trunk/core/cocoon-core/src/test/resources/org/apache/cocoon/components/source/impl/CachingSourceTestCase.xtest Tue Apr 3 01:10:48 2007 @@ -37,11 +37,6 @@ default-class="org.apache.excalibur.store.impl.StoreJanitorImpl" /> - <role name="org.apache.cocoon.components.source.helpers.SourceRefresher" - shorthand="delay-refresher" - default-class="org.apache.cocoon.components.source.helpers.DelaySourceRefresher" - /> - <role name="org.apache.excalibur.xml.sax.SAXParser" shorthand="xml-parser" default-class="org.apache.excalibur.xml.impl.JaxpParser" @@ -61,23 +56,11 @@ <components> <source-factories> - <component-instance class="org.apache.cocoon.components.source.impl.CachingSourceFactory" name="caching" logger="core.cachingsource"/> - <component-instance class="org.apache.cocoon.components.source.impl.CachingSourceFactory" name="async-caching" logger="core.asynchcachingsource"> - <parameter name="async" value="true"/> - </component-instance> <component-instance class="org.apache.cocoon.components.source.impl.XMLizableSourceFactory" name="xml" logger="core.xmlsource"/> <component-instance class="org.apache.excalibur.source.impl.FileSourceFactory" name="file" logger="core.filesource"/> <component-instance class="org.apache.excalibur.source.impl.ResourceSourceFactory" name="resource" logger="core.resourcesource"/> <component-instance class="org.apache.excalibur.source.impl.URLSourceFactory" name="*"/> </source-factories> - - <store logger="core.persistentstore"> - <parameter name="directory" value="cachingsourcetest"/> - </store> - - <delay-refresher logger="core.refresher"> - <parameter name="write-interval" value="10"/> - </delay-refresher> <xmlizer logger="core.xmlizer"> <parser mime-type="text/xml" role="org.apache.excalibur.xml.sax.SAXParser"/> From stephanie60@example.com Tue Apr 03 08:11:56 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 62438 invoked from network); 3 Apr 2007 08:11:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Apr 2007 08:11:51 -0000 Received: (qmail 7695 invoked by uid 500); 3 Apr 2007 08:11:58 -0000 Delivered-To: stephanie60@example.com Received: (qmail 7630 invoked by uid 500); 3 Apr 2007 08:11:58 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 7618 invoked by uid 99); 3 Apr 2007 08:11:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:11:57 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:11:50 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id CF2C31A983E; Tue, 3 Apr 2007 01:11:29 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r525077 - in /cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source: InspectableSource.java impl/InspectableAwareCachingSourceFactory.java impl/InspectableTraversableCachingSource.java Date: Tue, 03 Apr 2007 08:11:28 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Tue Apr 3 01:11:27 2007 New Revision: 525077 URL: http://svn.apache.org/viewvc?view=rev&rev=525077 Log: - Avalon->Spring - provide an abstract bean definition that can be used by any custom bean definition of caching sources - move dependency on InspectableSource to repository-impl (where it was before but as I refactored incrementally, it was easier to move things around) - all unit tests pass but the coverage of the refresher goes to 0 so I'm not sure if everything still works as expected - the refresher is setup via Spring too. This has the disadvantage that an "inline configuration" (-> within the bean definition) can't be provided anymore - javadocs still need to reflect my latest changes Added: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/InspectableSource.java - copied unchanged from r524896, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/InspectableSource.java cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java (with props) cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java - copied unchanged from r524896, cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/InspectableTraversableCachingSource.java Added: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java?view=auto&rev=525077 ============================================================================== --- cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java (added) +++ cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java Tue Apr 3 01:11:27 2007 @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.apache.cocoon.components.source.impl; + +import org.apache.cocoon.components.source.InspectableSource; +import org.apache.excalibur.source.Source; + +/** + * @version $Id$ + */ +public class InspectableAwareCachingSourceFactory extends CachingSourceFactory { + + protected CachingSource instantiateSource(String uri, String wrappedUri, Source wrappedSource, int expires, String cacheName, boolean fail) { + if (wrappedSource instanceof InspectableSource) { + return new InspectableTraversableCachingSource( + this, + this.scheme, + uri, + wrappedUri, + (InspectableSource) wrappedSource, + expires, + cacheName, + this.async, + this.validityStrategy, + fail); + } else { + return super.instantiateSource(uri, wrappedUri, wrappedSource, expires, cacheName, fail); + } + } + +} Propchange: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java ------------------------------------------------------------------------------ svn:keywords = Id Propchange: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java ------------------------------------------------------------------------------ svn:mime-type = text/plain From stephanie60@example.com Tue Apr 03 08:32:35 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 73554 invoked from network); 3 Apr 2007 08:32:34 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Apr 2007 08:32:34 -0000 Received: (qmail 38194 invoked by uid 500); 3 Apr 2007 08:32:42 -0000 Delivered-To: stephanie60@example.com Received: (qmail 38069 invoked by uid 500); 3 Apr 2007 08:32:41 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 38058 invoked by uid 99); 3 Apr 2007 08:32:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:32:41 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:32:33 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id BE41C1A9838; Tue, 3 Apr 2007 01:32:13 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r525083 - /cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java Date: Tue, 03 Apr 2007 08:32:13 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Tue Apr 3 01:32:12 2007 New Revision: 525083 URL: http://svn.apache.org/viewvc?view=rev&rev=525083 Log: javadocs Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java?view=diff&rev=525083&r1=525082&r2=525083 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java (original) +++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java Tue Apr 3 01:32:12 2007 @@ -73,46 +73,31 @@ * or {@link org.apache.cocoon.components.source.impl.TraversableCachingSource} * depending on the whether the wrapped Source is an instance of TraversableSource. * </p> - * - * <h2>Parameters</h2> - * <table><tbody> - * <tr> - * <th>cache-role (String)</th> - * <td>Role of component used as cache.</td> - * <td>opt</td> - * <td>String</td> - * <td><code>{@link Cache#ROLE}</code></td> - * </tr> - * <tr> - * <th>refresher-role (String)</th> - * <td>Role of component used for refreshing sources.</td> - * <td>opt</td> - * <td>String</td> - * <td><code>{@link org.apache.cocoon.components.source.helpers.SourceRefresher#ROLE}</code></td> - * </tr> - * <tr> - * <th>async (boolean)</th> - * <td>Indicated if the cached source should be refreshed asynchronously.</td> - * <td>opt</td> - * <td>String</td> - * <td><code>false</code></td> - * </tr> - * <tr> - * <th>event-aware (boolean)</th> - * <td>Whether to use event-based cache invalidation.</td> - * <td>opt</td> - * <td>String</td> - * <td><code>false</code></td> - * </tr> - * <tr> - * <th>default-expires (int)</th> - * <td>Default expiration value for if it is not specified on the Source itself.</td> - * <td>opt</td> - * <td>String</td> - * <td><code>-1</code></td> - * </tr> - * </tbody></table> - * + * <p> + * If other types of sources should be supported, subclass this class and override the method + * {@link #instantiateSource(String, String, Source, int, String, boolean)}. + * </p> + * <p> + * In order to use the CachingSourceFactory in Cocoon, you have to set it up as Spring bean. For this purpose + * you can use the abstract bean definition with the name + * <code>org.apache.excalibur.source.SourceFactory/caching888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stract</code>: + * <br> + * <code> + * &lt;bean name=&quot;org.apache.excalibur.source.SourceFactory/caching888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stract&quot; + * class=&quot;org.apache.cocoon.components.source.impl.CachingSourceFactory&quot; + * abstract=&quot;true&quot;&gt; + * &lt;property name=&quot;cache&quot; ref=&quot;org.apache.cocoon.caching.Cache&quot;/&gt; + * &lt;property name=&quot;sourceResolver&quot; ref=&quot;org.apache.excalibur.source.SourceResolver&quot;/&gt; + * &lt;property name=&quot;serviceManager&quot; ref=&quot;org.apache.avalon.framework.service.ServiceManager&quot;/&gt; + * &lt;property name=&quot;validityStrategy&quot;&gt; + * &lt;bean class=&quot;org.apache.cocoon.components.source.impl.ExpiresCachingSourceValidityStrategy&quot;/&gt; + * &lt;/property&gt; + * &lt;/bean&gt; + * </p> + * <p> + * It is also possible to override dependencies partially there. + * </p> + * * @version $Id$ * @since 2.1.1 */ @@ -299,13 +284,9 @@ } // ---------------------------------------------------- URIAbsolutizer - // implementation - /* - * (non-Javadoc) - * - * @see org.apache.excalibur.source.URIAbsolutizer#absolutize(java.lang.String, - * java.lang.String) + /** + * @see org.apache.excalibur.source.URIAbsolutizer#absolutize(java.lang.String, java.lang.String) */ public String absolutize(String baseURI, String location) { return SourceUtil.absolutize(baseURI, location, true); @@ -313,36 +294,58 @@ // ---------------------------------------------------- Set dependencies + /** + * Mandatory dependency on an implementation of {@link Cache}. + */ public void setCache(Cache cache) { this.cache = cache; } + /** + * Mandatory dependency on an implementation of {@link CachingSourceValidityStrategy}. + */ public void setValidityStrategy(CachingSourceValidityStrategy validityStrategy) { this.validityStrategy = validityStrategy; } + /** + * Mandatory dependency on an implementation of {@link ServiceManager}. + */ public void setServiceManager(ServiceManager serviceManager) { this.serviceManager = serviceManager; } + /** + * Mandatory dependency on an implementation of {@link SourceResolver}. + */ public void setSourceResolver(SourceResolver resolver) { this.resolver = resolver; } + /** + * Mandatory property of the used URI schema. + */ public void setScheme(String scheme) { this.scheme = scheme; } - // optional - + /** + * Optional dependency on an implementation of {@link SourceRefresher}. + */ public void setSourceRefresher(SourceRefresher refresher) { this.refresher = refresher; } + /** + * Optional property whether the source is asyncronous. The default value is <code>false</code>. + */ public void setAsync(boolean async) { this.async = async; } + /** + * Optional property the default expiry time in seconds. Default is <code>-1</code> which means that is valid forever. + */ public void setDefaultExpires(int expires) { this.defaultExpires = expires; } From stephanie60@example.com Tue Apr 03 08:33:04 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 73870 invoked from network); 3 Apr 2007 08:32:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Apr 2007 08:32:53 -0000 Received: (qmail 39045 invoked by uid 500); 3 Apr 2007 08:33:00 -0000 Delivered-To: stephanie60@example.com Received: (qmail 38994 invoked by uid 500); 3 Apr 2007 08:32:59 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 38983 invoked by uid 99); 3 Apr 2007 08:32:59 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:32:59 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:32:51 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 6DCBA1A983E; Tue, 3 Apr 2007 01:32:31 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r525084 - /cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java Date: Tue, 03 Apr 2007 08:32:31 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Tue Apr 3 01:32:30 2007 New Revision: 525084 URL: http://svn.apache.org/viewvc?view=rev&rev=525084 Log: javadocs Modified: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java Modified: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java?view=diff&rev=525084&r1=525083&r2=525084 ============================================================================== --- cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java (original) +++ cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/InspectableAwareCachingSourceFactory.java Tue Apr 3 01:32:30 2007 @@ -20,6 +20,9 @@ import org.apache.excalibur.source.Source; /** + * The InspectableAwareCachingSourceFactory inherits from {@link CachingSourceFactory} and only + * adds support for wrapped sources of type {@link InspectableSource}. + * * @version $Id$ */ public class InspectableAwareCachingSourceFactory extends CachingSourceFactory { From stephanie60@example.com Tue Apr 03 08:36:34 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 75288 invoked from network); 3 Apr 2007 08:36:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Apr 2007 08:36:32 -0000 Received: (qmail 43275 invoked by uid 500); 3 Apr 2007 08:36:39 -0000 Delivered-To: stephanie60@example.com Received: (qmail 43218 invoked by uid 500); 3 Apr 2007 08:36:38 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 43207 invoked by uid 99); 3 Apr 2007 08:36:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:36:38 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:36:31 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id BB8301A9838; Tue, 3 Apr 2007 01:36:10 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r525086 - in /cocoon/trunk/core/cocoon-core/src: main/java/org/apache/cocoon/components/source/impl/ main/resources/META-INF/cocoon/spring/ test/java/org/apache/cocoon/components/source/impl/ Date: Tue, 03 Apr 2007 08:36:10 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Tue Apr 3 01:36:09 2007 New Revision: 525086 URL: http://svn.apache.org/viewvc?view=rev&rev=525086 Log: align Spring config with documentation (caching -> cached) Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java?view=diff&rev=525086&r1=525085&r2=525086 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java (original) +++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java Tue Apr 3 01:36:09 2007 @@ -83,7 +83,7 @@ * <code>org.apache.excalibur.source.SourceFactory/caching888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stract</code>: * <br> * <code> - * &lt;bean name=&quot;org.apache.excalibur.source.SourceFactory/caching888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stract&quot; + * &lt;bean name=&quot;org.apache.excalibur.source.SourceFactory/cach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4abstract&quot; * class=&quot;org.apache.cocoon.components.source.impl.CachingSourceFactory&quot; * abstract=&quot;true&quot;&gt; * &lt;property name=&quot;cache&quot; ref=&quot;org.apache.cocoon.caching.Cache&quot;/&gt; Modified: cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml?view=diff&rev=525086&r1=525085&r2=525086 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml (original) +++ cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml Tue Apr 3 01:36:09 2007 @@ -24,7 +24,7 @@ | An abstract CachingSource bean definition providing correct dependencies for most | usage scenarios. This avoid code duplication. +--> - <bean name="org.apache.excalibur.source.SourceFactory/caching888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stract" + <bean name="org.apache.excalibur.source.SourceFactory/cach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4abstract" class="org.apache.cocoon.components.source.impl.CachingSourceFactory" abstract="true"> <property name="cache" ref="org.apache.cocoon.caching.Cache"/> @@ -35,10 +35,10 @@ </property> </bean> - <bean name="org.apache.excalibur.source.SourceFactory/caching" + <bean name="org.apache.excalibur.source.SourceFactory/cached" class="org.apache.cocoon.components.source.impl.CachingSourceFactory" - parent="org.apache.excalibur.source.SourceFactory/caching888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stract" - p:scheme="caching"/> + parent="org.apache.excalibur.source.SourceFactory/cach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4abstract" + p:scheme="cached"/> <bean name="org.apache.cocoon.components.source.helpers.DelaySourceRefresher" class="org.apache.cocoon.components.source.helpers.DelaySourceRefresher" @@ -51,10 +51,10 @@ <property name="avalonContext" ref="org.apache.avalon.framework.context.Context"/> </bean> - <bean name="org.apache.excalibur.source.SourceFactory/async-caching" + <bean name="org.apache.excalibur.source.SourceFactory/async-cached" class="org.apache.cocoon.components.source.impl.CachingSourceFactory" - parent="org.apache.excalibur.source.SourceFactory/caching888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4stract" - p:scheme="async-caching" + parent="org.apache.excalibur.source.SourceFactory/cach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4abstract" + p:scheme="async-cached" p:async="true"> <property name="sourceRefresher" ref="org.apache.cocoon.components.source.helpers.DelaySourceRefresher"/> </bean> Modified: cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java?view=diff&rev=525086&r1=525085&r2=525086 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java (original) +++ cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/components/source/impl/CachingSourceTestCase.java Tue Apr 3 01:36:09 2007 @@ -44,11 +44,11 @@ } public void testResolveURI() throws Exception { - testResolveURI("caching", URI); + testResolveURI("cached", URI); } public void testResolveAsyncURI() throws Exception { - testResolveURI("async-caching", URI); + testResolveURI("async-cached", URI); } private void testResolveURI(final String scheme, final String uri) throws Exception { @@ -70,7 +70,7 @@ } public void testCachingURI() throws Exception { - String uri = "caching:http://slashdot.org/?cocoon:cache-expires=1"; + String uri = "cached:http://slashdot.org/?cocoon:cache-expires=1"; CachingSource source; @@ -108,7 +108,7 @@ } public void testRefreshSyncURI() throws Exception { - testRefreshURI("caching", "http://slashdot.org/"); + testRefreshURI("cached", "http://slashdot.org/"); } // public void testRefreshAsyncURI() throws Exception { @@ -143,7 +143,7 @@ } public void testCachingTraversableSource() throws Exception { - String scheme = "caching"; + String scheme = "cached"; File cwd = new File(".").getCanonicalFile(); String childURI = cwd.toURL().toString(); String parentURI = cwd.getParentFile().toURL().toString(); @@ -182,7 +182,7 @@ public void testGetContents() throws Exception { // resolve CachingSource - String scheme = "caching"; + String scheme = "cached"; String uri = "resource://org/apache/cocoon/components/source/impl/cachingsourcetest.xml"; CachingSource source = (CachingSource) resolver.resolveURI(scheme + ":" + uri); From stephanie60@example.com Tue Apr 03 08:57:38 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 79240 invoked from network); 3 Apr 2007 08:57:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Apr 2007 08:57:35 -0000 Received: (qmail 66972 invoked by uid 500); 3 Apr 2007 08:57:42 -0000 Delivered-To: stephanie60@example.com Received: (qmail 66828 invoked by uid 500); 3 Apr 2007 08:57:41 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 66817 invoked by uid 99); 3 Apr 2007 08:57:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:57:41 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:57:34 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id C8A3C1A9838; Tue, 3 Apr 2007 01:57:13 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r525094 - in /cocoon/trunk/blocks/cocoon-eventcache/cocoon-eventcache-impl/src/main/java/org/apache/cocoon/components: ./ source/ source/impl/ source/impl/EventAwareCachingSourceValidityStrategy.java Date: Tue, 03 Apr 2007 08:57:13 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Tue Apr 3 01:57:12 2007 New Revision: 525094 URL: http://svn.apache.org/viewvc?view=rev&rev=525094 Log: - move strategy to event-cache block as there is no reason why it should be in repository-impl Added: cocoon/trunk/blocks/cocoon-eventcache/cocoon-eventcache-impl/src/main/java/org/apache/cocoon/components/ cocoon/trunk/blocks/cocoon-eventcache/cocoon-eventcache-impl/src/main/java/org/apache/cocoon/components/source/ cocoon/trunk/blocks/cocoon-eventcache/cocoon-eventcache-impl/src/main/java/org/apache/cocoon/components/source/impl/ cocoon/trunk/blocks/cocoon-eventcache/cocoon-eventcache-impl/src/main/java/org/apache/cocoon/components/source/impl/EventAwareCachingSourceValidityStrategy.java - copied unchanged from r524887, cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/EventAwareCachingSourceValidityStrategy.java From stephanie60@example.com Tue Apr 03 08:57:41 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 79353 invoked from network); 3 Apr 2007 08:57:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 3 Apr 2007 08:57:39 -0000 Received: (qmail 67143 invoked by uid 500); 3 Apr 2007 08:57:46 -0000 Delivered-To: stephanie60@example.com Received: (qmail 67026 invoked by uid 500); 3 Apr 2007 08:57:46 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 67015 invoked by uid 99); 3 Apr 2007 08:57:46 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:57:46 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Apr 2007 01:57:38 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 5CB2E1A983E; Tue, 3 Apr 2007 01:57:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r525095 - /cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/EventAwareCachingSourceValidityStrategy.java Date: Tue, 03 Apr 2007 08:57:18 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Tue Apr 3 01:57:17 2007 New Revision: 525095 URL: http://svn.apache.org/viewvc?view=rev&rev=525095 Log: - move strategy to event-cache block as there is no reason why it should be in repository-impl Removed: cocoon/trunk/blocks/cocoon-repository/cocoon-repository-impl/src/main/java/org/apache/cocoon/components/source/impl/EventAwareCachingSourceValidityStrategy.java From stephanie60@example.com Wed Apr 04 10:04:58 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 17521 invoked from network); 4 Apr 2007 10:04:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Apr 2007 10:04:55 -0000 Received: (qmail 83192 invoked by uid 500); 4 Apr 2007 10:05:02 -0000 Delivered-To: stephanie60@example.com Received: (qmail 83126 invoked by uid 500); 4 Apr 2007 10:05:02 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 83082 invoked by uid 99); 4 Apr 2007 10:05:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2007 03:05:02 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Apr 2007 03:04:54 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 106821A9838; Wed, 4 Apr 2007 03:04:34 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r525482 - in /cocoon/trunk/core/cocoon-core/src/main: java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml Date: Wed, 04 Apr 2007 10:04:33 -0000 To: stephanie60@example.com From: stephanie60@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <stephanie60@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: reinhard Date: Wed Apr 4 03:04:31 2007 New Revision: 525482 URL: http://svn.apache.org/viewvc?view=rev&rev=525482 Log: define protocol scheme only once Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml Modified: cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java?view=diff&rev=525482&r1=525481&r2=525482 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java (original) +++ cocoon/trunk/core/cocoon-core/src/main/java/org/apache/cocoon/components/source/impl/CachingSourceFactory.java Wed Apr 4 03:04:31 2007 @@ -38,6 +38,7 @@ import org.apache.excalibur.source.SourceUtil; import org.apache.excalibur.source.TraversableSource; import org.apache.excalibur.source.URIAbsolutizer; +import org.springframework.beans.factory.BeanNameAware; /** * This class implements a proxy like source caches the contents of the source @@ -101,7 +102,7 @@ * @version $Id$ * @since 2.1.1 */ -public class CachingSourceFactory implements URIAbsolutizer, SourceFactory { +public class CachingSourceFactory implements URIAbsolutizer, SourceFactory, BeanNameAware { private Log logger = LogFactory.getLog(getClass()); @@ -321,13 +322,6 @@ public void setSourceResolver(SourceResolver resolver) { this.resolver = resolver; } - - /** - * Mandatory property of the used URI schema. - */ - public void setScheme(String scheme) { - this.scheme = scheme; - } /** * Optional dependency on an implementation of {@link SourceRefresher}. @@ -348,6 +342,13 @@ */ public void setDefaultExpires(int expires) { this.defaultExpires = expires; + } + + // ---------------------------------------------------- BeanNameAware + + public void setBeanName(String beanName) { + int pos = beanName.lastIndexOf('/'); + this.scheme = beanName.substring(pos + 1); } } Modified: cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml?view=diff&rev=525482&r1=525481&r2=525482 ============================================================================== --- cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml (original) +++ cocoon/trunk/core/cocoon-core/src/main/resources/META-INF/cocoon/spring/cocoon-core-caching-source.xml Wed Apr 4 03:04:31 2007 @@ -37,8 +37,7 @@ <bean name="org.apache.excalibur.source.SourceFactory/cached" class="org.apache.cocoon.components.source.impl.CachingSourceFactory" - parent="org.apache.excalibur.source.SourceFactory/cach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4abstract" - p:scheme="cached"/> + parent="org.apache.excalibur.source.SourceFactory/cach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4abstract"/> <bean name="org.apache.cocoon.components.source.helpers.DelaySourceRefresher" class="org.apache.cocoon.components.source.helpers.DelaySourceRefresher" @@ -54,7 +53,6 @@ <bean name="org.apache.excalibur.source.SourceFactory/async-cached" class="org.apache.cocoon.components.source.impl.CachingSourceFactory" parent="org.apache.excalibur.source.SourceFactory/cach888a:dbb7:2d49:b3f6:8605:bf4e:caed:e5a4abstract" - p:scheme="async-cached" p:async="true"> <property name="sourceRefresher" ref="org.apache.cocoon.components.source.helpers.DelaySourceRefresher"/> </bean> From stephanie60@example.com Wed Apr 04 17:36:01 2007 Return-Path: <stephanie60@example.com> Delivered-To: stephanie60@example.com Received: (qmail 87158 invoked from network); 4 Apr 2007 17:35:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 4 Apr 2007 17:35:59 -0000 Received: (qmail 22966 invoked by uid 500); 4 Apr 2007 17:36:05 -0000 Delivered-To: stephanie60@example.com Received: (qmail 22883 invoked by uid 500); 4 Apr 2007 17:36:04 -0000 Mailing-List: contact stephanie60@example.com; run by ezmlm Precedence: bulk Reply-To: stephanie60@example.com list-help: <mailto:stephanie60@example.com> list-unsubscribe: <mailto:stephanie60@example.com> List-Post: <mailto:stephanie60@example.com> List-Id: <cvs.cocoon.apache.org> Delivered-To: mailing list stephanie60@example.com Received: (qmail 22846 invoked by uid 99); 4 Apr 2007 17:36:04 -0000 Received: from
{'source': 'Apache Software Foundation Public Mail Archives'}