You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by ke...@apache.org on 2010/08/17 18:16:26 UTC

svn commit: r986369 - in /openejb/branches/openejb-3.1.x: container/openejb-core/src/main/java/org/apache/openejb/core/stateful/ container/openejb-core/src/main/resources/ examples/alternate-descriptors/src/main/resources/META-INF/

Author: kevan
Date: Tue Aug 17 16:16:25 2010
New Revision: 986369

URL: http://svn.apache.org/viewvc?rev=986369&view=rev
Log:
OPENEJB-1144 merge 953472 to branches/openejb-3.1.x

Modified:
    openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java
    openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainerFactory.java
    openejb/branches/openejb-3.1.x/container/openejb-core/src/main/resources/default.openejb.conf
    openejb/branches/openejb-3.1.x/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml   (props changed)

Modified: openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java?rev=986369&r1=986368&r2=986369&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java (original)
+++ openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java Tue Aug 17 16:16:25 2010
@@ -26,6 +26,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
 import javax.ejb.EJBAccessException;
 import javax.ejb.EJBException;
 import javax.ejb.EJBHome;
@@ -84,6 +85,7 @@ import org.apache.openejb.spi.SecuritySe
 import org.apache.openejb.util.Index;
 import org.apache.openejb.util.LogCategory;
 import org.apache.openejb.util.Logger;
+import org.apache.openejb.util.Duration;
 import org.apache.xbean.recipe.ConstructionException;
 
 public class StatefulContainer implements RpcContainer {
@@ -91,6 +93,7 @@ public class StatefulContainer implement
 
     private final Object containerID;
     private final SecurityService securityService;
+    private final Duration accessTimeout;
 
     // todo this should be part of the constructor
     protected final JtaEntityManagerRegistry entityManagerRegistry = SystemInstance.get().getComponent(JtaEntityManagerRegistry.class);
@@ -104,10 +107,15 @@ public class StatefulContainer implement
     private final ConcurrentHashMap<Object, Instance> checkedOutInstances = new ConcurrentHashMap<Object, Instance>();
 
     public StatefulContainer(Object id, SecurityService securityService, Cache<Object, Instance> cache) {
+        this(id, securityService, cache, new Duration(0, TimeUnit.MILLISECONDS));
+    }
+
+    public StatefulContainer(Object id, SecurityService securityService, Cache<Object, Instance> cache, Duration accessTimeout) {
         this.containerID = id;
         this.securityService = securityService;
         this.cache = cache;
         cache.setListener(new StatefulCacheListener());
+        this.accessTimeout = accessTimeout;
     }
 
     private Map<Method, MethodType> getLifecycleMethodsOfInterface(CoreDeploymentInfo deploymentInfo) {

Modified: openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainerFactory.java
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainerFactory.java?rev=986369&r1=986368&r2=986369&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainerFactory.java (original)
+++ openejb/branches/openejb-3.1.x/container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainerFactory.java Tue Aug 17 16:16:25 2010
@@ -18,9 +18,11 @@
 package org.apache.openejb.core.stateful;
 
 import java.util.Properties;
+import java.util.concurrent.TimeUnit;
 import java.util.Map.Entry;
 
 import org.apache.openejb.spi.SecurityService;
+import org.apache.openejb.util.Duration;
 import org.apache.xbean.recipe.ObjectRecipe;
 import org.apache.xbean.recipe.Option;
 
@@ -29,6 +31,7 @@ public class StatefulContainerFactory {
     private SecurityService securityService;
     private Cache<Object, Instance> cache;
     private Properties properties = new Properties();
+    private Duration accessTimeout = new Duration(0, TimeUnit.MILLISECONDS);
 
     public Object getId() {
         return id;
@@ -46,6 +49,14 @@ public class StatefulContainerFactory {
         this.securityService = securityService;
     }
 
+    public Duration getAccessTimeout() {
+        return accessTimeout;
+    }
+
+    public void setAccessTimeout(Duration accessTimeout) {
+        this.accessTimeout = accessTimeout;
+    }
+
     public Cache<Object, Instance> getCache() {
         return cache;
     }
@@ -87,7 +98,7 @@ public class StatefulContainerFactory {
         if (cache == null) {
             buildCache();
         }
-        return new StatefulContainer(id, securityService, cache);
+        return new StatefulContainer(id, securityService, cache, accessTimeout);
     }
 
     private void buildCache() throws Exception {

Modified: openejb/branches/openejb-3.1.x/container/openejb-core/src/main/resources/default.openejb.conf
URL: http://svn.apache.org/viewvc/openejb/branches/openejb-3.1.x/container/openejb-core/src/main/resources/default.openejb.conf?rev=986369&r1=986368&r2=986369&view=diff
==============================================================================
--- openejb/branches/openejb-3.1.x/container/openejb-core/src/main/resources/default.openejb.conf (original)
+++ openejb/branches/openejb-3.1.x/container/openejb-core/src/main/resources/default.openejb.conf Tue Aug 17 16:16:25 2010
@@ -15,6 +15,18 @@
 
   AccessTimeout = 0 milliseconds
 
+  # 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.
+  #
+  # Usable time units: nanoseconds, microsecons, milliseconds,
+  # seconds, minutes, hours, days.  Or any combination such as
+  # "1 hour and 27 minutes and 10 seconds"
+
+  AccessTimeout = 0 milliseconds
+
   #  The passivator is responsible for writing beans to disk
   #  at passivation time. Different passivators can be used
   #  by setting this property to the fully qualified class name

Propchange: openejb/branches/openejb-3.1.x/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 17 16:16:25 2010
@@ -1,2 +1,2 @@
 /openejb/branches/openejb-3.1.1/examples/alternate-descriptors/src/main/resources/META-INF/ejb-jar.xml:779593
-/openejb/trunk/openejb3/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:943472,943862,943965,944757,945989,946399,946485,946489,946705,946792,946805,946814,946861,946863-946864,947010,947017,947042,948022,948241,948243,948548,949014,949233,950391,950801,951611,953191,953196,953556,955104,955496,957463,962382,962750
+/openejb/trunk/openejb3/examples/alternate-descriptors/src/main/resources/META-INF/test.ejb-jar.xml:943472,943862,943965,944757,945989,946399,946485,946489,946705,946792,946805,946814,946861,946863-946864,947010,947017,947042,948022,948241,948243,948548,949014,949233,950391,950801,951611,953191,953196,953472,953556,955104,955496,957463,962382,962750