cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sylv...@apache.org
Subject svn commit: r293303 - /cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/PartSourceFactory.java
Date Mon, 03 Oct 2005 11:03:31 GMT
Author: sylvain
Date: Mon Oct  3 04:03:25 2005
New Revision: 293303

URL: http://svn.apache.org/viewcvs?rev=293303&view=rev
Log:
Make ThreadSafe

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/PartSourceFactory.java

Modified: cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/PartSourceFactory.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/PartSourceFactory.java?rev=293303&r1=293302&r2=293303&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/PartSourceFactory.java
(original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/source/impl/PartSourceFactory.java
Mon Oct  3 04:03:25 2005
@@ -15,8 +15,10 @@
  */
 package org.apache.cocoon.components.source.impl;
 
+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.thread.ThreadSafe;
 import org.apache.cocoon.components.ContextHelper;
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceFactory;
@@ -29,10 +31,11 @@
  * A factory for {@link org.apache.cocoon.servlet.multipart.Part} based sources (see {@link
PartSource}).
  *
  * @author <a href="mailto:paul.crabtree@dna.co.uk">Paul Crabtree</a>
+ * @version $Id$
  */
-public class PartSourceFactory implements SourceFactory, Contextualizable
+public class PartSourceFactory implements SourceFactory, Contextualizable, ThreadSafe
 {
-    Map objectModel;
+    Context context;
     
     /*
      * Returns a new {@link PartSource} based on the uri.
@@ -41,7 +44,8 @@
      */
     public Source getSource(String uri, Map parameters) throws IOException, MalformedURLException
     {
-        return new PartSource(uri, this.objectModel);
+        Map objectModel = ContextHelper.getObjectModel(context);
+        return new PartSource(uri, objectModel);
     }
 
     /**
@@ -59,6 +63,6 @@
      */
     public void contextualize(org.apache.avalon.framework.context.Context context)
     throws ContextException {
-         this.objectModel = ContextHelper.getObjectModel(context);
+         this.context = context;
     }
 }



Mime
View raw message