[jboss-cvs] JBossAS SVN: r112297 - in tags/JBPAPP_5_1_2_ER2: testsuite and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Oct 7 11:32:49 EDT 2011
Author: mbenitez
Date: 2011-10-07 11:32:49 -0400 (Fri, 07 Oct 2011)
New Revision: 112297
Modified:
tags/JBPAPP_5_1_2_ER2/ejb3/src/main/org/jboss/ejb3/iiop/BeanCorbaServant.java
tags/JBPAPP_5_1_2_ER2/ejb3/src/main/org/jboss/ejb3/iiop/IORFactory.java
tags/JBPAPP_5_1_2_ER2/testsuite/build.xml
Log:
Merge from branch JBPAPP_5_1: r112293/r112294 JBPAPP-7341: add csiv2 interceptor to one-iiop-test, so security is working / JBPAPP-7341: make sure the correct TCCL is set before processing the invocation
Modified: tags/JBPAPP_5_1_2_ER2/ejb3/src/main/org/jboss/ejb3/iiop/BeanCorbaServant.java
===================================================================
--- tags/JBPAPP_5_1_2_ER2/ejb3/src/main/org/jboss/ejb3/iiop/BeanCorbaServant.java 2011-10-07 10:58:44 UTC (rev 112296)
+++ tags/JBPAPP_5_1_2_ER2/ejb3/src/main/org/jboss/ejb3/iiop/BeanCorbaServant.java 2011-10-07 15:32:49 UTC (rev 112297)
@@ -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: tags/JBPAPP_5_1_2_ER2/ejb3/src/main/org/jboss/ejb3/iiop/IORFactory.java
===================================================================
--- tags/JBPAPP_5_1_2_ER2/ejb3/src/main/org/jboss/ejb3/iiop/IORFactory.java 2011-10-07 10:58:44 UTC (rev 112296)
+++ tags/JBPAPP_5_1_2_ER2/ejb3/src/main/org/jboss/ejb3/iiop/IORFactory.java 2011-10-07 15:32:49 UTC (rev 112297)
@@ -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();
Modified: tags/JBPAPP_5_1_2_ER2/testsuite/build.xml
===================================================================
--- tags/JBPAPP_5_1_2_ER2/testsuite/build.xml 2011-10-07 10:58:44 UTC (rev 112296)
+++ tags/JBPAPP_5_1_2_ER2/testsuite/build.xml 2011-10-07 15:32:49 UTC (rev 112297)
@@ -4859,6 +4859,7 @@
<jvmarg value="-Djacorb.security.ssl.client.required_options=0"/>
<jvmarg value="-DORBInitRef.NameService=corbaloc::${node0}:3528/JBoss/Naming/root"/>
<jvmarg value="-Dorg.omg.PortableInterceptor.ORBInitializerClass.org.jboss.tm.iiop.TxClientInterceptorInitializer"/>
+ <jvmarg value="-Dorg.omg.PortableInterceptor.ORBInitializerClass.org.jboss.iiop.csiv2.SASClientInitializer"/>
<jvmarg value="-Djava.security.manager"/>
<jvmarg value="-Djava.security.policy==${build.resources}/iiop/client.policy"/>
<jvmarg value="-Djava.naming.factory.url.pkgs=org.jboss.naming.client"/>
More information about the jboss-cvs-commits
mailing list