You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by dj...@apache.org on 2008/06/17 21:52:26 UTC
svn commit: r668812 -
/geronimo/server/branches/2.0/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java
Author: djencks
Date: Tue Jun 17 12:52:26 2008
New Revision: 668812
URL: http://svn.apache.org/viewvc?rev=668812&view=rev
Log:
GERONIMO-4119 port contextID reset fix from trunk
Modified:
geronimo/server/branches/2.0/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java
Modified: geronimo/server/branches/2.0/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.0/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java?rev=668812&r1=668811&r2=668812&view=diff
==============================================================================
--- geronimo/server/branches/2.0/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java (original)
+++ geronimo/server/branches/2.0/modules/geronimo-openejb/src/main/java/org/apache/geronimo/openejb/GeronimoThreadContextListener.java Tue Jun 17 12:52:26 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;
}
}