geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From djen...@apache.org
Subject svn commit: r668765 - /geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java
Date Tue, 17 Jun 2008 17:39:32 GMT
Author: djencks
Date: Tue Jun 17 10:39:32 2008
New Revision: 668765

URL: http://svn.apache.org/viewvc?rev=668765&view=rev
Log:
GERONIMO-4119 Reset ContextID on exit

Modified:
    geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java

Modified: geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java?rev=668765&r1=668764&r2=668765&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java
(original)
+++ geronimo/server/trunk/plugins/openejb/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java
Tue Jun 17 10:39:32 2008
@@ -76,11 +76,7 @@
         // Geronimo call context is used to track old state that must be restored
         GeronimoCallContext geronimoCallContext = new GeronimoCallContext();
 
-        // Get the jndi context
-        Context jndiContext = ejbDeployment.getComponentContext();
-        geronimoCallContext.oldJndiContext = RootContext.getComponentContext();
-
-        // Demark component boundries for connection tracking if we have a tracker
+        // Demarcate component boundaries for connection tracking if we have a tracker
         TrackedConnectionAssociator trackedConnectionAssociator = ejbDeployment.getTrackedConnectionAssociator();
         if (trackedConnectionAssociator != null) {
             // create the connector context... this only works with a TrackedConnectionAssociator
using lazy association
@@ -96,10 +92,14 @@
             }
         }
 
+        // Get the jndi context
+        Context jndiContext = ejbDeployment.getComponentContext();
+        geronimoCallContext.oldJndiContext = RootContext.getComponentContext();
         // Set the jndi context into Geronimo's root context
         RootContext.setComponentContext(jndiContext);
 
         // set the policy (security) context id
+        geronimoCallContext.contextID = PolicyContext.getContextID();
         String moduleID = newContext.getDeploymentInfo().getModuleID();
         PolicyContext.setContextID(moduleID);
 
@@ -139,6 +139,9 @@
             ContextManager.clearCallers();
         }
 
+        //reset ContextID
+        PolicyContext.setContextID(geronimoCallContext.contextID);
+
         // reset Geronimo's root jndi context
         RootContext.setComponentContext(geronimoCallContext.oldJndiContext);
 
@@ -158,5 +161,6 @@
         private ConnectorInstanceContext oldConnectorContext;
         private boolean clearCallers;
         private Callers callers;
+        private String contextID;
     }
 }



Mime
View raw message