[jboss-cvs] JBossAS SVN: r112294 - branches/JBPAPP_5_1/ejb3/src/main/org/jboss/ejb3/iiop.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Oct 6 06:27:20 EDT 2011
Author: wolfc
Date: 2011-10-06 06:27:20 -0400 (Thu, 06 Oct 2011)
New Revision: 112294
Modified:
branches/JBPAPP_5_1/ejb3/src/main/org/jboss/ejb3/iiop/BeanCorbaServant.java
branches/JBPAPP_5_1/ejb3/src/main/org/jboss/ejb3/iiop/IORFactory.java
Log:
JBPAPP-7341: make sure the correct TCCL is set before processing the invocation
Modified: branches/JBPAPP_5_1/ejb3/src/main/org/jboss/ejb3/iiop/BeanCorbaServant.java
===================================================================
--- branches/JBPAPP_5_1/ejb3/src/main/org/jboss/ejb3/iiop/BeanCorbaServant.java 2011-10-05 15:31:17 UTC (rev 112293)
+++ branches/JBPAPP_5_1/ejb3/src/main/org/jboss/ejb3/iiop/BeanCorbaServant.java 2011-10-06 10:27:20 UTC (rev 112294)
@@ -21,16 +21,6 @@
*/
package org.jboss.ejb3.iiop;
-import java.io.Serializable;
-import java.lang.reflect.Method;
-import java.security.Principal;
-import java.util.HashMap;
-
-import javax.ejb.EJBAccessException;
-import javax.ejb.EJBTransactionRequiredException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
import org.jboss.ejb3.core.proxy.spi.CurrentRemoteProxyFactory;
import org.jboss.ejb3.endpoint.Endpoint;
import org.jboss.ejb3.session.SessionContainer;
@@ -50,9 +40,9 @@
import org.omg.CORBA.BAD_OPERATION;
import org.omg.CORBA.InterfaceDef;
import org.omg.CORBA.NO_PERMISSION;
+import org.omg.CORBA.ORBPackage.InvalidName;
import org.omg.CORBA.SystemException;
import org.omg.CORBA.TRANSACTION_REQUIRED;
-import org.omg.CORBA.ORBPackage.InvalidName;
import org.omg.CORBA.portable.InputStream;
import org.omg.CORBA.portable.InvokeHandler;
import org.omg.CORBA.portable.OutputStream;
@@ -61,6 +51,15 @@
import org.omg.PortableServer.POA;
import org.omg.PortableServer.Servant;
+import javax.ejb.EJBAccessException;
+import javax.ejb.EJBTransactionRequiredException;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import java.io.Serializable;
+import java.lang.reflect.Method;
+import java.security.Principal;
+import java.util.HashMap;
+
/**
* Comment
*
@@ -76,6 +75,7 @@
private final IORFactory factory;
private final Current poaCurrent;
private final Endpoint container;
+ private final ClassLoader containerClassLoader;
private final InterfaceDef interfaceDef;
private final String repositoryIds[];
private SASCurrent sasCurrent;
@@ -83,7 +83,7 @@
private HashMap<String, SkeletonStrategy> methodMap;
- protected BeanCorbaServant(IORFactory factory, Current poaCurrent, Endpoint container, InterfaceDef interfaceDef, InterfaceAnalysis interfaceAnalysis)
+ protected BeanCorbaServant(IORFactory factory, Current poaCurrent, Endpoint container, ClassLoader containerClassLoader, InterfaceDef interfaceDef, InterfaceAnalysis interfaceAnalysis)
{
assert factory != null : "factory is null";
assert poaCurrent != null : "poaCurrent is null";
@@ -95,6 +95,7 @@
this.factory = factory;
this.poaCurrent = poaCurrent;
this.container = container;
+ this.containerClassLoader = containerClassLoader;
this.interfaceDef = interfaceDef;
this.repositoryIds = interfaceAnalysis.getAllTypeIds();
@@ -172,8 +173,11 @@
}
org.omg.CORBA_2_3.portable.OutputStream out;
+ ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
try
{
+ Thread.currentThread().setContextClassLoader(containerClassLoader);
+
Object id = ReferenceData.extractObjectId(poaCurrent.get_object_id());
log.trace("id = " + id);
@@ -245,6 +249,10 @@
else
throw new RuntimeException("NYI");
}
+ finally
+ {
+ Thread.currentThread().setContextClassLoader(oldCl);
+ }
return out;
}
Modified: branches/JBPAPP_5_1/ejb3/src/main/org/jboss/ejb3/iiop/IORFactory.java
===================================================================
--- branches/JBPAPP_5_1/ejb3/src/main/org/jboss/ejb3/iiop/IORFactory.java 2011-10-05 15:31:17 UTC (rev 112293)
+++ branches/JBPAPP_5_1/ejb3/src/main/org/jboss/ejb3/iiop/IORFactory.java 2011-10-06 10:27:20 UTC (rev 112294)
@@ -372,7 +372,7 @@
log.debug("binding servant name " + getServantName());
- Servant servant = new BeanCorbaServant(this, poaCurrent, container, interfaceDef, interfaceAnalysis);
+ Servant servant = new BeanCorbaServant(this, poaCurrent, container, container.getClassloader(), interfaceDef, interfaceAnalysis);
this.referenceFactory = servantRegistry.bind(getServantName(), servant, policies);
EJBObject corbaObj = (EJBObject) createProxy();
@@ -382,7 +382,7 @@
// TODO: use iri
if(homeInterfaceAnalysis != null)
{
- servant = new BeanCorbaServant(this, poaCurrent, container, null, homeInterfaceAnalysis);
+ servant = new BeanCorbaServant(this, poaCurrent, container, container.getClassloader(), null, homeInterfaceAnalysis);
this.homeReferenceFactory = homeServantRegistry.bind(getServantName() + "Home", servant, policies);
Object homeObject = createHomeProxy();
More information about the jboss-cvs-commits
mailing list