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

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Thu Mar 20 21:38:23 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-03-20 21:38:23 -0400 (Thu, 20 Mar 2008)
New Revision: 3707

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
Log:
JBREM-934: Put PropertyEditors.mapJavaBeanProperties() in AccessController.doPrivileged() call.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java	2008-03-21 01:37:50 UTC (rev 3706)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/transport/rmi/RMIServerInvoker.java	2008-03-21 01:38:23 UTC (rev 3707)
@@ -44,6 +44,7 @@
 
 import javax.net.SocketFactory;
 
+import java.beans.IntrospectionException;
 import java.io.BufferedOutputStream;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -60,6 +61,9 @@
 import java.rmi.server.RemoteServer;
 import java.rmi.server.ServerNotActiveException;
 import java.rmi.server.UnicastRemoteObject;
+import java.security.AccessController;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -141,9 +145,26 @@
    
    protected void setup() throws Exception
    {
-      Properties props = new Properties();
+      final Properties props = new Properties();
       props.putAll(getConfiguration());
-      PropertyEditors.mapJavaBeanProperties(this, props, false);
+      
+      try
+      {
+         AccessController.doPrivileged( new PrivilegedExceptionAction()
+         {
+            public Object run() throws IntrospectionException
+            {
+               PropertyEditors.mapJavaBeanProperties(this, props, false);
+               return null;
+            }
+         });
+      }
+      catch (PrivilegedActionException e)
+      {
+         log.debug(e.toString(), e);
+         throw e;
+      }
+      
       super.setup();
    }
    




More information about the jboss-remoting-commits mailing list