geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dwo...@apache.org
Subject svn commit: r634445 - in /geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb: EjbDeployment.java GeronimoThreadContextListener.java
Date Thu, 06 Mar 2008 23:02:09 GMT
Author: dwoods
Date: Thu Mar  6 15:02:08 2008
New Revision: 634445

URL: http://svn.apache.org/viewvc?rev=634445&view=rev
Log:
GERONIMO-3780 - MDB unable to access JNDI in ejbPostCreate

Modified:
    geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
    geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java

Modified: geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java?rev=634445&r1=634444&r2=634445&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
(original)
+++ geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/EjbDeployment.java
Thu Mar  6 15:02:08 2008
@@ -280,13 +280,17 @@
         if (componentContext != null) {
             javaCompSubContext.bind("geronimo", componentContext);
         }
-        deploymentInfo.set(EjbDeployment.class, this);
+        synchronized(deploymentInfo){
+            deploymentInfo.set(EjbDeployment.class, this);
+       	    deploymentInfo.notifyAll();
+        }
     }
 
     protected void stop() {
         if (deploymentInfo != null) {
-            deploymentInfo.set(EjbDeployment.class, null);
-            deploymentInfo = null;
-        }
+	    deploymentInfo.setDestroyed(true);
+	    deploymentInfo.set(EjbDeployment.class, null);
+	    deploymentInfo = null;
+	}	
     }
 }

Modified: geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java?rev=634445&r1=634444&r2=634445&view=diff
==============================================================================
--- geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java
(original)
+++ geronimo/server/branches/2.1/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java
Thu Mar  6 15:02:08 2008
@@ -57,7 +57,19 @@
     public void contextEntered(ThreadContext oldContext, ThreadContext newContext) {
         CoreDeploymentInfo deploymentInfo = newContext.getDeploymentInfo();
         if (deploymentInfo == null) return;
-
+        if (deploymentInfo.get(EjbDeployment.class) == null) {
+	    synchronized (deploymentInfo) {
+                if (deploymentInfo.get(EjbDeployment.class) == null) {
+                    if (!deploymentInfo.isDestroyed()) {
+                        try {
+                            deploymentInfo.wait();
+                        } catch (InterruptedException e) {
+                        log.warn("Wait on deploymentInfo interrupted unexpectedly");
+                        }
+                    }
+                }
+            }
+        } 
         EjbDeployment ejbDeployment = deploymentInfo.get(EjbDeployment.class);
         if (ejbDeployment == null) return;
 



Mime
View raw message