Author: vgritsenko
Date: Thu Oct 21 17:24:59 2004
New Revision: 55287

Modified:
   
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java
Log:
Add synchronization to EnvironmentDescription methods.
Required in cases when Sources are used in multiple threads
(ex: SitemapSource in IncludeTransformer in parallel mode).


Modified: 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java
==============================================================================
--- 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java
      (original)
+++ 
cocoon/branches/BRANCH_2_1_X/src/java/org/apache/cocoon/components/CocoonComponentManager.java
      Thu Oct 21 17:24:59 2004
@@ -592,7 +592,7 @@
      * All RequestLifecycleComponents and autoreleaseComponents are
      * released.
      */
-    void release() {
+    synchronized void release() {
         if (this.requestLifecycleComponents != null) {
             final Iterator iter = 
this.requestLifecycleComponents.values().iterator();
             while (iter.hasNext()) {
@@ -686,7 +686,7 @@
     /**
      * Add an automatically released component
      */
-    void addToAutoRelease(final ComponentSelector selector,
+    synchronized void addToAutoRelease(final ComponentSelector selector,
                                        final Component         component,
                                        final ComponentManager  manager) {
         this.autoreleaseComponents.add(new Object[] {component, selector, 
manager});
@@ -695,7 +695,7 @@
     /**
      * Add an automatically released component
      */
-    void addToAutoRelease(final ComponentManager manager,
+    synchronized void addToAutoRelease(final ComponentManager manager,
                                        final Component        component) {
         this.autoreleaseComponents.add(new Object[] {component, manager});
     }
@@ -703,7 +703,7 @@
     /**
      * Remove from automatically released components
      */
-    void removeFromAutoRelease(final Component component)
+    synchronized void removeFromAutoRelease(final Component component)
     throws ProcessingException {
         int i = 0;
         boolean found = false;

Reply via email to