cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/source/impl SitemapSource.java
Date Mon, 13 Jan 2003 14:38:17 GMT
cziegeler    2003/01/13 06:38:17

  Modified:    src/java/org/apache/cocoon/components/pipeline/impl
                        AbstractCachingProcessingPipeline.java
                        SourceDeferredValidity.java
               src/java/org/apache/cocoon/components/pipeline
                        ProcessingPipeline.java
                        AbstractProcessingPipeline.java
               src/java/org/apache/cocoon/components/source/impl
                        SitemapSource.java
  Log:
  Next step for caching
  
  Revision  Changes    Path
  1.17      +9 -4      xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java
  
  Index: AbstractCachingProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/impl/AbstractCachingProcessingPipeline.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- AbstractCachingProcessingPipeline.java	13 Jan 2003 13:12:29 -0000	1.16
  +++ AbstractCachingProcessingPipeline.java	13 Jan 2003 14:38:16 -0000	1.17
  @@ -63,6 +63,7 @@
   import org.apache.cocoon.environment.Environment;
   import org.apache.cocoon.transformation.Transformer;
   import org.apache.excalibur.source.SourceValidity;
  +import org.apache.excalibur.source.impl.validity.DeferredAggregatedValidity;
   
   import java.io.ByteArrayOutputStream;
   import java.io.OutputStream;
  @@ -769,10 +770,14 @@
        * serializer) is cacheable and valid, return all validity objects.
        * Otherwise return <code>null</code>
        */
  -    public SourceValidity[] getValiditiesForEventPipeline() {
  +    public SourceValidity getValidityForEventPipeline() {
           if (!this.completeResponseIsCached
                   && this.firstNotCacheableTransformerIndex == super.transformers.size())
{
  -            return this.toCacheSourceValidities;
  +            DeferredAggregatedValidity validity = new DeferredAggregatedValidity();
  +            for(int i=0; i < this.toCacheKey.size(); i++) {
  +                validity.add(new SourceDeferredValidity(this, i));
  +            }
  +            return validity;
           }
           return null;
       }
  @@ -781,7 +786,7 @@
        * 
        * @see org.apache.cocoon.components.pipeline.ProcessingPipeline#getValidityForInternalPipeline(int)
        */
  -    protected SourceValidity getValidityForInternalPipeline(int index) {
  +    SourceValidity getValidityForInternalPipeline(int index) {
           final SourceValidity validity;
           if (index == 0) {
               // test generator
  
  
  
  1.2       +4 -5      xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/impl/SourceDeferredValidity.java
  
  Index: SourceDeferredValidity.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/impl/SourceDeferredValidity.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- SourceDeferredValidity.java	13 Jan 2003 13:12:29 -0000	1.1
  +++ SourceDeferredValidity.java	13 Jan 2003 14:38:16 -0000	1.2
  @@ -63,11 +63,10 @@
    */
   public final class SourceDeferredValidity implements DeferredValidity {
   
  -    private ProcessingPipeline pipeline;
  +    private AbstractCachingProcessingPipeline pipeline;
       private int index;
  -    private SourceValidity[] validities;
       
  -    public SourceDeferredValidity(ProcessingPipeline pipeline, int index) {
  +    public SourceDeferredValidity(AbstractCachingProcessingPipeline pipeline, int index)
{
           this.pipeline = pipeline;
           this.index = index;
       }
  @@ -76,7 +75,7 @@
   	 * @see org.apache.excalibur.source.impl.validity.DeferredValidity#getValidity()
   	 */
   	public SourceValidity getValidity() {
  -		return this.validities[this.index];
  +		return pipeline.getValidityForInternalPipeline(this.index);
   	}
   
   }
  
  
  
  1.16      +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/ProcessingPipeline.java
  
  Index: ProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/ProcessingPipeline.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ProcessingPipeline.java	13 Jan 2003 13:12:29 -0000	1.15
  +++ ProcessingPipeline.java	13 Jan 2003 14:38:16 -0000	1.16
  @@ -181,6 +181,6 @@
        * serializer) is cacheable and valid, return all validity objects.
        * Otherwise return <code>null</code>
        */
  -    SourceValidity[] getValiditiesForEventPipeline();
  +    SourceValidity getValidityForEventPipeline();
   
   }
  
  
  
  1.30      +2 -2      xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java
  
  Index: AbstractProcessingPipeline.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/AbstractProcessingPipeline.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- AbstractProcessingPipeline.java	13 Jan 2003 13:12:29 -0000	1.29
  +++ AbstractProcessingPipeline.java	13 Jan 2003 14:38:16 -0000	1.30
  @@ -680,7 +680,7 @@
        * serializer) is cacheable and valid, return all validity objects.
        * Otherwise return <code>null</code>
        */
  -    public SourceValidity[] getValiditiesForEventPipeline() {
  +    public SourceValidity getValidityForEventPipeline() {
           return null;
       }
   
  
  
  
  1.34      +2 -11     xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java
  
  Index: SitemapSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/impl/SitemapSource.java,v
  retrieving revision 1.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- SitemapSource.java	10 Jan 2003 14:19:45 -0000	1.33
  +++ SitemapSource.java	13 Jan 2003 14:38:17 -0000	1.34
  @@ -69,7 +69,6 @@
   import org.apache.excalibur.source.SourceException;
   import org.apache.excalibur.source.SourceNotFoundException;
   import org.apache.excalibur.source.SourceValidity;
  -import org.apache.excalibur.source.impl.validity.DeferredAggregatedValidity;
   import org.xml.sax.Attributes;
   import org.xml.sax.ContentHandler;
   import org.xml.sax.Locator;
  @@ -340,15 +339,7 @@
               this.pipelineProcessor = this.environment.changeToLastContext();
               String redirectURL = this.environment.getRedirectURL();
               if (redirectURL == null) {
  -                SourceValidity[] eventPipelineValidities = this.processingPipeline.getValiditiesForEventPipeline();
  -                if ( eventPipelineValidities != null ) {
  -                    DeferredAggregatedValidity av = new DeferredAggregatedValidity();
  -   			        for(int i=0; i < eventPipelineValidities.length;i++) {
  -					    av.add(eventPipelineValidities[i]);
  -                    }
  -                    this.sourceValidity = av;
  -                	
  -                }
  +                this.sourceValidity = this.processingPipeline.getValidityForEventPipeline();
               } else {
                   if (redirectURL.indexOf(":") == -1) {
                       redirectURL = this.protocol + ":/" + redirectURL;
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message