cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
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 GMT
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/cached::abstract"
-    p:scheme="cached"/>
+    parent="org.apache.excalibur.source.SourceFactory/cached::abstract"/>
     
   <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/cached::abstract"
-    p:scheme="async-cached"
     p:async="true">
     <property name="sourceRefresher" ref="org.apache.cocoon.components.source.helpers.DelaySourceRefresher"/>
   </bean>



Mime
View raw message