[jboss-remoting-commits] JBoss Remoting SVN: r3895 - remoting2/branches/2.x/src/main/org/jboss/remoting/transport/local.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Fri Apr 4 18:35:09 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-04 18:35:09 -0400 (Fri, 04 Apr 2008)
New Revision: 3895

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/transport/local/LocalClientInvoker.java
Log:
JBREM-934: Put call to JBossSerializationManager.createMarshalledValueForClone() in AccessController.doPrivileged() call.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/local/LocalClientInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/local/LocalClientInvoker.java	2008-04-04 22:31:20 UTC (rev 3894)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/local/LocalClientInvoker.java	2008-04-04 22:35:09 UTC (rev 3895)
@@ -31,11 +31,15 @@
 import org.jboss.remoting.ServerInvoker;
 import org.jboss.remoting.marshal.Marshaller;
 import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.remoting.serialization.SerializationManager;
 import org.jboss.remoting.serialization.SerializationStreamFactory;
 import org.jboss.remoting.transport.BidirectionalClientInvoker;
 import org.jboss.logging.Logger;
 
 import java.io.IOException;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.Map;
 
 /**
@@ -147,8 +151,33 @@
 
    protected InvocationRequest marshallInvocation(InvocationRequest localInvocation) throws IOException, ClassNotFoundException
    {
-      Object param = localInvocation.getParameter();
-      Object newParam = SerializationStreamFactory.getManagerInstance(getSerializationType()).createMarshalledValueForClone(param).get();
+      final Object param = localInvocation.getParameter();
+      Object newParam = null;
+      String serializationType = getSerializationType();
+      final SerializationManager manager = SerializationStreamFactory.getManagerInstance(serializationType);
+
+      if (serializationType.indexOf("jboss") < 0)
+      {
+         newParam = manager.createMarshalledValueForClone(param).get();
+      }
+      else
+      {
+         try
+         {
+            newParam = AccessController.doPrivileged( new PrivilegedExceptionAction()
+            {
+               public Object run() throws Exception
+               {
+                  return manager.createMarshalledValueForClone(param).get();
+               }
+            });
+         }
+         catch (PrivilegedActionException e)
+         {
+            throw (IOException) e.getCause();
+         }
+      }
+      
       localInvocation.setParameter(newParam);
       return localInvocation;
    }




More information about the jboss-remoting-commits mailing list