geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From genspr...@apache.org
Subject svn commit: r1091820 - in /geronimo/server/trunk/plugins/openejb: geronimo-openejb/src/main/java/org/apache/geronimo/openejb/ openejb/ openejb/src/main/plan/
Date Wed, 13 Apr 2011 15:35:57 GMT
Author: genspring
Date: Wed Apr 13 15:35:56 2011
New Revision: 1091820

URL: http://svn.apache.org/viewvc?rev=1091820&view=rev
Log:
adding accessTimeout setting for stateful container, change accessTimeout of stateless ejb
container from 0 to -1.

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java
    geronimo/server/trunk/plugins/openejb/openejb/pom.xml
    geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java?rev=1091820&r1=1091819&r2=1091820&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatefulContainerGBean.java
Wed Apr 13 15:35:56 2011
@@ -23,8 +23,10 @@ import org.apache.geronimo.gbean.annotat
 import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.openejb.assembler.classic.StatefulSessionContainerInfo;
+import org.apache.openejb.util.Duration;
 
 import java.util.Properties;
+import java.util.concurrent.TimeUnit;
 
 /**
  * @version $Rev$ $Date$
@@ -33,6 +35,15 @@ import java.util.Properties;
 public class StatefulContainerGBean extends EjbContainer {
 
     /**
+     * Specifies the maximum time an invocation could wait for the stateful bean instance
to become available before
+     * giving up.
+     * 
+     * After the timeout is reached a javax.ejb.ConcurrentAccessTimeoutException will be
thrown.
+     */
+    private final int accessTimeout;   
+    
+    
+    /**
      * Maximum number of values that should be in the LRU
      */
     private final int capacity;
@@ -55,14 +66,18 @@ public class StatefulContainerGBean exte
             @ParamReference(name = "OpenEjbSystem") OpenEjbSystem openEjbSystem,
             @ParamAttribute(name = "provider") String provider,
             @ParamAttribute(name = "bulkPassivate") int bulkPassivate,
+            @ParamAttribute(name = "accessTimeout") int accessTimeout,
             @ParamAttribute(name = "capacity") int capacity,
             @ParamAttribute(name = "timeout") long timeout,
             @ParamAttribute(name = "properties") Properties properties) {
         super(abstractName, StatefulSessionContainerInfo.class, openEjbSystem, provider,
"STATEFUL", properties);
         set("BulkPassivate", Integer.toString(bulkPassivate));
+        Duration accessTimeoutDuration = new Duration(accessTimeout, TimeUnit.SECONDS);
+        set("AccessTimeout", accessTimeoutDuration.toString());
         set("Capacity", Integer.toString(capacity));
         set("TimeOut", Long.toString(timeout));
         this.bulkPassivate = bulkPassivate;
+        this.accessTimeout = accessTimeout;
         this.capacity = capacity;
         this.timeout = timeout;
     }

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java?rev=1091820&r1=1091819&r2=1091820&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/StatelessContainerGBean.java
Wed Apr 13 15:35:56 2011
@@ -23,8 +23,10 @@ import org.apache.geronimo.gbean.annotat
 import org.apache.geronimo.gbean.annotation.SpecialAttributeType;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.openejb.assembler.classic.StatelessSessionContainerInfo;
+import org.apache.openejb.util.Duration;
 
 import java.util.Properties;
+import java.util.concurrent.TimeUnit;
 
 /**
  * @version $Rev$ $Date$
@@ -33,10 +35,10 @@ import java.util.Properties;
 public class StatelessContainerGBean extends EjbContainer {
 
     /**
-     * Specifies the time to wait between invocations. This
-     * value is measured in milliseconds. A value of 5 would
-     * result in a time-out of 5 milliseconds between invocations.
-     * A value of zero would mean no timeout.
+     * Specifies the time an invokation should wait for an instance of the pool to become
available.
+     * 
+     * After the timeout is reached, if an instance in the pool cannot be obtained, the method
invocation will fail.
+     * 
      */
     private final int accessTimeout;
     
@@ -100,9 +102,12 @@ public class StatelessContainerGBean ext
         set("MaxSize", Integer.toString(maxSize));
         set("MinSize", Integer.toString(minSize));        
         set("StrictPooling", Boolean.toString(strictPooling));
-        set("AccessTimeout", Integer.toString(accessTimeout));
-        set("CloseTimeout", Integer.toString(closeTimeout));
-        set("IdleTimeout", Integer.toString(idleTimeout));
+        Duration accessTimeoutDuration = new Duration(accessTimeout, TimeUnit.SECONDS);
+        set("AccessTimeout", accessTimeoutDuration.toString());
+        Duration closeTimeoutDuration = new Duration(closeTimeout, TimeUnit.MINUTES);
+        set("CloseTimeout", closeTimeoutDuration.toString());
+        Duration idleTimeoutDuration = new Duration(idleTimeout, TimeUnit.MINUTES);
+        set("IdleTimeout", idleTimeoutDuration.toString());
         this.maxSize = maxSize;
         this.minSize= minSize;
         this.strictPooling = strictPooling;

Modified: geronimo/server/trunk/plugins/openejb/openejb/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb/pom.xml?rev=1091820&r1=1091819&r2=1091820&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb/pom.xml (original)
+++ geronimo/server/trunk/plugins/openejb/openejb/pom.xml Wed Apr 13 15:35:56 2011
@@ -169,6 +169,7 @@
                                     <attribute name="clusterName">${ClusterName}</attribute>
                                 </gbean>
                                 <gbean name="DefaultStatefulContainer">
+                                    <attribute name="accessTimeout">${StatefulAccessTimeout}</attribute>
                                     <attribute name="timeout">${StatefulTimeout}</attribute>
                                     <attribute name="capacity">${StatefulCapacity}</attribute>
                                     <attribute name="bulkPassivate">${StatefulBulkPassivate}</attribute>
@@ -189,13 +190,14 @@
                                 </gbean>
                             </config-xml-content>
                             <config-substitution key="OpenEJBPort">4201</config-substitution>
+                            <config-substitution key="StatefulAccessTimeout">-1</config-substitution>
                             <config-substitution key="StatefulTimeout">20</config-substitution>
                             <config-substitution key="StatefulCapacity">1000</config-substitution>
                             <config-substitution key="StatefulBulkPassivate">100</config-substitution>
                             <config-substitution key="SingletonAccessTimeout">30</config-substitution>
                             <config-substitution key="BMPPoolSize">10</config-substitution>
-                            <config-substitution key="StatelessAccessTimeout">0</config-substitution>
-                            <config-substitution key="StatelessCloseTimeout">300000</config-substitution>
                           
+                            <config-substitution key="StatelessAccessTimeout">-1</config-substitution>
+                            <config-substitution key="StatelessCloseTimeout">5</config-substitution>
                           
                             <config-substitution key="StatelessPoolSize">10</config-substitution>

                             <config-substitution key="StatelessMinPoolSize">0</config-substitution>
                            
                             <config-substitution key="StatelessStrictPooling">true</config-substitution>

Modified: geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml?rev=1091820&r1=1091819&r2=1091820&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml (original)
+++ geronimo/server/trunk/plugins/openejb/openejb/src/main/plan/plan.xml Wed Apr 13 15:35:56
2011
@@ -42,8 +42,8 @@
     </gbean>
 
     <gbean name="DefaultStatelessContainer" class="org.apache.geronimo.openejb.StatelessContainerGBean">
-        <attribute name="accessTimeout">0</attribute>
-        <attribute name="closeTimeout">300000</attribute>          
+        <attribute name="accessTimeout">-1</attribute>
+        <attribute name="closeTimeout">5</attribute>          
         <attribute name="maxSize">10</attribute>
         <attribute name="minSize">0</attribute>
         <attribute name="strictPooling">true</attribute>
@@ -53,6 +53,7 @@
         </reference>
     </gbean>
     <gbean name="DefaultStatefulContainer" class="org.apache.geronimo.openejb.StatefulContainerGBean">
+        <attribute name="accessTimeout">-1</attribute>
         <attribute name="timeout">20</attribute>
         <attribute name="capacity">1000</attribute>
         <attribute name="bulkPassivate">100</attribute>
@@ -61,7 +62,7 @@
         </reference>
     </gbean>
     <gbean name="DefaultSingletonContainer" class="org.apache.geronimo.openejb.SingletonContainerGBean">
-        <attribute name="accessTimeout">30</attribute>
+        <attribute name="accessTimeout">-1</attribute>
         <reference name="OpenEjbSystem">
             <name>OpenEjbSystem</name>
         </reference>



Mime
View raw message