cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cziege...@apache.org
Subject svn commit: r153755 - in cocoon/trunk: ./ src/core/java/org/apache/cocoon/components/ src/core/java/org/apache/cocoon/core/container/handler/ src/java/org/apache/cocoon/components/treeprocessor/
Date Mon, 14 Feb 2005 09:48:52 GMT
Author: cziegeler
Date: Mon Feb 14 01:48:49 2005
New Revision: 153755

URL: http://svn.apache.org/viewcvs?view=rev&rev=153755
Log:
    Create proxies for pooled components. Pooled components can now be used in the same
    way as thread safe components, the client code does not need to know if they are pooled
anymore.

Modified:
    cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java
    cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/AbstractComponentHandler.java
    cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/ProcessorComponentInfo.java
    cocoon/trunk/status.xml

Modified: cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java?view=diff&r1=153754&r2=153755
==============================================================================
--- cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java (original)
+++ cocoon/trunk/src/core/java/org/apache/cocoon/components/ComponentInfo.java Mon Feb 14
01:48:49 2005
@@ -30,6 +30,10 @@
     public static final int MODEL_POOLED    = 2;
     public static final int MODEL_NON_THREAD_SAFE_POOLED = 3;
     
+    public static final String TYPE_SINGLETON = "singleton";
+    public static final String TYPE_POOLED = "pooled";
+    public static final String TYPE_NON_THREAD_SAFE_POOLED = "non-thread-safe-pooled";
+
     private int model;
     private String initMethodName;
     private String destroyMethodName;
@@ -153,15 +157,15 @@
     public void fill(Configuration attr) {
         // test model
         final String model = attr.getAttribute("model", null);
-        if ( "pooled".equals(model) ) {
+        if ( TYPE_POOLED.equals(model) ) {
             this.setModel(ComponentInfo.MODEL_POOLED);
             this.setPoolInMethodName(attr.getAttribute("pool-in", null));
             this.setPoolOutMethodName(attr.getAttribute("pool-out", null));
-        } else if ("non-thread-safe-pooled".equals(model)) {
+        } else if (TYPE_NON_THREAD_SAFE_POOLED.equals(model)) {
             this.setModel(ComponentInfo.MODEL_NON_THREAD_SAFE_POOLED);
             this.setPoolInMethodName(attr.getAttribute("pool-in", null));
             this.setPoolOutMethodName(attr.getAttribute("pool-out", null));
-        } else if ( "singleton".equals(model) ) {
+        } else if ( TYPE_SINGLETON.equals(model) ) {
             this.setModel(ComponentInfo.MODEL_SINGLETON);
         }
         this.setInitMethodName(attr.getAttribute("init", null));

Modified: cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/AbstractComponentHandler.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/AbstractComponentHandler.java?view=diff&r1=153754&r2=153755
==============================================================================
--- cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/AbstractComponentHandler.java
(original)
+++ cocoon/trunk/src/core/java/org/apache/cocoon/core/container/handler/AbstractComponentHandler.java
Mon Feb 14 01:48:49 2005
@@ -97,9 +97,8 @@
 
         if( Poolable.class.isAssignableFrom( componentClass ) ) {
             numInterfaces++;
-            // FIXME : Activate proxied pooling as default
-            info.setModel(ComponentInfo.MODEL_NON_THREAD_SAFE_POOLED);
-            if ( "non-thread-safe-pooled".equals(info.getConfiguration().getAttribute("model",
null))) {
+            info.setModel(ComponentInfo.MODEL_POOLED);
+            if ( ComponentInfo.TYPE_NON_THREAD_SAFE_POOLED.equals(info.getConfiguration().getAttribute("model",
null))) {
                 info.setModel(ComponentInfo.MODEL_NON_THREAD_SAFE_POOLED);
             }
         }

Modified: cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/ProcessorComponentInfo.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/ProcessorComponentInfo.java?view=diff&r1=153754&r2=153755
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/ProcessorComponentInfo.java
(original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/treeprocessor/ProcessorComponentInfo.java
Mon Feb 14 01:48:49 2005
@@ -26,6 +26,7 @@
 import org.apache.avalon.framework.configuration.DefaultConfiguration;
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.cocoon.acting.Action;
+import org.apache.cocoon.components.ComponentInfo;
 import org.apache.cocoon.components.pipeline.ProcessingPipeline;
 import org.apache.cocoon.core.container.DefaultServiceSelector;
 import org.apache.cocoon.generation.Generator;
@@ -128,7 +129,7 @@
             || role.startsWith(READER_PREFIX)
             || role.startsWith(PIPELINE_PREFIX)) {
             
-            ((DefaultConfiguration)config).setAttribute("model", "non-thread-safe-pooled");
+            ((DefaultConfiguration)config).setAttribute("model", ComponentInfo.TYPE_NON_THREAD_SAFE_POOLED);
         }
     }
 

Modified: cocoon/trunk/status.xml
URL: http://svn.apache.org/viewcvs/cocoon/trunk/status.xml?view=diff&r1=153754&r2=153755
==============================================================================
--- cocoon/trunk/status.xml (original)
+++ cocoon/trunk/status.xml Mon Feb 14 01:48:49 2005
@@ -203,6 +203,10 @@
   <changes>
  <release version="@version@" date="@date@">
    <action dev="CZ" type="update">
+    Create proxies for pooled components. Pooled components can now be used in the same
+    way as thread safe components, the client code does not need to know if they are pooled
anymore.
+   </action>
+   <action dev="CZ" type="update">
     Move XSP logicsheets from the databases block to the xsp block.
    </action>
    <action dev="CZ" type="update">



Mime
View raw message