cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgritse...@apache.org
Subject svn commit: r606651 - in /cocoon/trunk/core/cocoon-sitemap: cocoon-sitemap-api/src/main/java/org/apache/cocoon/ cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/source/impl/ cocoon-sitemap-impl/src/main/java/org/apache/cocoon/compon...
Date Mon, 24 Dec 2007 01:21:52 GMT
Author: vgritsenko
Date: Sun Dec 23 17:21:51 2007
New Revision: 606651

URL: http://svn.apache.org/viewvc?rev=606651&view=rev
Log:
Get rid of InternalPipelineDescription.pipelineSelector.

Modified:
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-api/src/main/java/org/apache/cocoon/Processor.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/source/impl/SitemapSource.java
    cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-api/src/main/java/org/apache/cocoon/Processor.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-api/src/main/java/org/apache/cocoon/Processor.java?rev=606651&r1=606650&r2=606651&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-api/src/main/java/org/apache/cocoon/Processor.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-api/src/main/java/org/apache/cocoon/Processor.java
Sun Dec 23 17:21:51 2007
@@ -17,7 +17,7 @@
 package org.apache.cocoon;
 
 import org.apache.avalon.framework.service.ServiceManager;
-import org.apache.avalon.framework.service.ServiceSelector;
+
 import org.apache.cocoon.components.pipeline.ProcessingPipeline;
 import org.apache.cocoon.environment.Environment;
 import org.apache.cocoon.environment.SourceResolver;
@@ -32,34 +32,40 @@
     String ROLE = Processor.class.getName();
 
     /**
-     *
+     * Keeps together processing pipeline, its owners, and environment state variables.
      */
     public static class InternalPipelineDescription {
-        
-        public ProcessingPipeline processingPipeline;
+
+        /** Processor owning this service manager and pipeline */
+        public Processor processor;
+
+        /** Service manager of this pipeline */
         public ServiceManager pipelineManager;
-        public ServiceSelector pipelineSelector;
-        public Processor lastProcessor;
+
+        /** Processing pipeline itself */
+        public ProcessingPipeline processingPipeline;
+
+        /** Environment prefix */
         public String prefix;
+
+        /** Environment URI */
         public String uri;
 
-        public InternalPipelineDescription(ProcessingPipeline pipeline,
-                                           ServiceSelector selector,
-                                           ServiceManager manager) {
-            this.processingPipeline = pipeline;
-            this.pipelineSelector = selector;
+        public InternalPipelineDescription(Processor processor,
+                                           ServiceManager manager,
+                                           ProcessingPipeline pipeline) {
+            this.processor = processor;
             this.pipelineManager = manager;
+            this.processingPipeline = pipeline;
         }
 
         public void release() {
-            if (this.pipelineSelector != null) {
-                this.pipelineSelector.release(this.processingPipeline);
-                this.pipelineManager.release(this.pipelineSelector);
+            if (this.pipelineManager != null) {
+                this.pipelineManager.release(this.processingPipeline);
             }
-            this.lastProcessor = null;
             this.processingPipeline = null;
             this.pipelineManager = null;
-            this.pipelineSelector = null;
+            this.processor = null;
         }
     }
     

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/source/impl/SitemapSource.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/source/impl/SitemapSource.java?rev=606651&r1=606650&r2=606651&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/source/impl/SitemapSource.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-components/src/main/java/org/apache/cocoon/components/source/impl/SitemapSource.java
Sun Dec 23 17:21:51 2007
@@ -192,7 +192,7 @@
         try {
             ByteArrayOutputStream os = new ByteArrayOutputStream();
             this.environment.setOutputStream(os);
-            EnvironmentHelper.enterProcessor(this.pipelineDescription.lastProcessor,
+            EnvironmentHelper.enterProcessor(this.pipelineDescription.processor,
                                              this.environment);
             try {
 
@@ -286,7 +286,7 @@
             String redirectURL = this.environment.getRedirectURL();
             if (redirectURL == null) {
 
-                EnvironmentHelper.enterProcessor(this.pipelineDescription.lastProcessor,
+                EnvironmentHelper.enterProcessor(this.pipelineDescription.processor,
                                                  this.environment);
                 try {
                     this.pipelineDescription.processingPipeline.prepareInternal(this.environment);
@@ -356,7 +356,7 @@
                 }
                 // We have to add an environment changer
                 // for clean environment stack handling.
-                EnvironmentHelper.enterProcessor(this.pipelineDescription.lastProcessor,
+                EnvironmentHelper.enterProcessor(this.pipelineDescription.processor,
                                                  this.environment);
                 try {
                     this.pipelineDescription.processingPipeline.process(this.environment,

Modified: cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java?rev=606651&r1=606650&r2=606651&view=diff
==============================================================================
--- cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
(original)
+++ cocoon/trunk/core/cocoon-sitemap/cocoon-sitemap-impl/src/main/java/org/apache/cocoon/components/treeprocessor/InvokeContext.java
Sun Dec 23 17:21:51 2007
@@ -26,7 +26,6 @@
 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.ServiceSelector;
 import org.apache.avalon.framework.service.Serviceable;
 
 import org.apache.cocoon.Processor;
@@ -84,9 +83,6 @@
     /** The parameters for the processing pipeline */
     protected Parameters processingPipelineParameters;
 
-    /** The Selector for the processing pipeline */
-    protected ServiceSelector pipelineSelector;
-
     /** The ProcessingPipeline used */
     protected ProcessingPipeline processingPipeline;
 
@@ -203,13 +199,13 @@
             // Keep current manager for proper release
             this.pipelinesManager = this.currentManager;
 
-            this.pipelineSelector = (ServiceSelector)this.pipelinesManager.lookup(ProcessingPipeline.ROLE+"Selector");
-            this.processingPipeline = (ProcessingPipeline)this.pipelineSelector.select(this.processingPipelineType);
-            this.processingPipeline.setProcessorManager(this.currentManager);
+            this.processingPipeline = (ProcessingPipeline) this.pipelinesManager.lookup(ProcessingPipeline.ROLE
+ '/' + this.processingPipelineType);
+            this.processingPipeline.setProcessorManager(this.pipelinesManager);
 
             this.processingPipeline.setup(this.processingPipelineParameters);
             this.processingPipeline.setErrorHandler(this.errorHandler);
         }
+
         return this.processingPipeline;
     }
 
@@ -219,11 +215,8 @@
     public void setInternalPipelineDescription(Processor.InternalPipelineDescription desc)
{
         this.processingPipeline = desc.processingPipeline;
         this.pipelinesManager = desc.pipelineManager;
-        this.lastProcessor = desc.lastProcessor;
-        this.pipelineSelector = desc.pipelineSelector;
-        this.internalPipelineDescription = new Processor.InternalPipelineDescription(
-                this.processingPipeline, this.pipelineSelector, this.pipelinesManager);
-        this.internalPipelineDescription.lastProcessor = this.lastProcessor;
+        this.lastProcessor = desc.processor;
+        this.internalPipelineDescription = new Processor.InternalPipelineDescription(this.lastProcessor,
this.pipelinesManager, this.processingPipeline);
         this.internalPipelineDescription.prefix = desc.prefix;
         this.internalPipelineDescription.uri = desc.uri;
     }
@@ -233,9 +226,7 @@
      */
     public Processor.InternalPipelineDescription getInternalPipelineDescription(Environment
env) {
         if (this.internalPipelineDescription == null) {
-            this.internalPipelineDescription = new Processor.InternalPipelineDescription(
-                    this.processingPipeline, this.pipelineSelector, this.pipelinesManager);
-            this.internalPipelineDescription.lastProcessor = this.lastProcessor;
+            this.internalPipelineDescription = new Processor.InternalPipelineDescription(this.lastProcessor,
this.pipelinesManager, this.processingPipeline);
             this.internalPipelineDescription.prefix = env.getURIPrefix();
             this.internalPipelineDescription.uri = env.getURI();
         }
@@ -345,12 +336,8 @@
     public void dispose() {
         if (this.internalPipelineDescription == null && this.pipelinesManager !=
null) {
             if (this.processingPipeline != null) {
-                this.pipelineSelector.release(this.processingPipeline);
+                this.pipelinesManager.release(this.processingPipeline);
                 this.processingPipeline = null;
-            }
-            if (this.pipelineSelector != null) {
-                this.pipelinesManager.release(this.pipelineSelector);
-                this.pipelineSelector = null;
             }
             this.pipelinesManager = null;
 



Mime
View raw message