[jboss-remoting-commits] JBoss Remoting SVN: r3841 - remoting2/branches/2.x/src/main/org/jboss/remoting/security.

jboss-remoting-commits at lists.jboss.org jboss-remoting-commits at lists.jboss.org
Wed Apr 2 00:07:13 EDT 2008


Author: ron.sigal at jboss.com
Date: 2008-04-02 00:07:13 -0400 (Wed, 02 Apr 2008)
New Revision: 3841

Modified:
   remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java
Log:
JBREM-934: (1) Replace System.getProperty() calls with SystemUtility.getSystemProperty() calls; (2) put Thread().getContextClassLoader() calls in AccessController.doPrivileged() calls.

Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java	2008-04-02 04:04:08 UTC (rev 3840)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java	2008-04-02 04:07:13 UTC (rev 3841)
@@ -22,8 +22,8 @@
 package org.jboss.remoting.security;
 
 import org.jboss.logging.Logger;
-import org.jboss.remoting.callback.CallbackStore.StoreFileFilter;
 import org.jboss.remoting.serialization.ClassLoaderUtility;
+import org.jboss.remoting.util.SystemUtility;
 import org.jboss.remoting.util.socket.RemotingKeyManager;
 
 import javax.net.ServerSocketFactory;
@@ -396,7 +396,8 @@
 
       if (getUseSSLSocketFactory())
       {
-         String defaultFactoryName = System.getProperty(REMOTING_DEFAULT_SOCKET_FACTORY_CLASS);
+         String defaultFactoryName = SystemUtility.getSystemProperty(REMOTING_DEFAULT_SOCKET_FACTORY_CLASS);
+         
          if (defaultFactoryName != null)
          {
             try
@@ -630,7 +631,7 @@
 
       if(keyStoreFilePath == null)
       {
-         String path = System.getProperty(STANDARD_KEY_STORE_FILE_PATH);
+         String path = SystemUtility.getSystemProperty(STANDARD_KEY_STORE_FILE_PATH);;
          if(path != null && path.length() > 0)
          {
             setKeyStoreURL( path );
@@ -684,8 +685,7 @@
 
       if(keyStoreType == null)
       {
-         keyStoreType = System.getProperty(STANDARD_KEY_STORE_TYPE);
-
+         keyStoreType = SystemUtility.getSystemProperty(STANDARD_KEY_STORE_TYPE);
          if(keyStoreType == null)
          {
             keyStoreType = DEFAULT_KEY_STORE_TYPE;
@@ -761,7 +761,7 @@
 
       if(keyStorePassword == null)
       {
-         keyStorePassword = System.getProperty(STANDARD_KEY_STORE_PASSWORD);
+         keyStorePassword = SystemUtility.getSystemProperty(STANDARD_KEY_STORE_PASSWORD);
       }
 
       return keyStorePassword;
@@ -812,7 +812,7 @@
 
       if(trustStoreFilePath == null)
       {
-         String path = System.getProperty(STANDARD_TRUST_STORE_FILE_PATH);
+         String path = SystemUtility.getSystemProperty(STANDARD_TRUST_STORE_FILE_PATH);
          if(path != null && path.length() > 0)
          {
             setTrustStoreURL( path );
@@ -866,8 +866,7 @@
 
       if(trustStoreType == null)
       {
-         trustStoreType = System.getProperty(STANDARD_TRUST_STORE_TYPE);
-
+         trustStoreType = SystemUtility.getSystemProperty(STANDARD_TRUST_STORE_TYPE);
          if(trustStoreType == null)
          {
             trustStoreType = getKeyStoreType();
@@ -943,7 +942,7 @@
 
       if(trustStorePassword == null)
       {
-         trustStorePassword = System.getProperty(STANDARD_TRUST_STORE_PASSWORD);
+         trustStorePassword = SystemUtility.getSystemProperty(STANDARD_TRUST_STORE_PASSWORD);
          if(trustStorePassword == null)
          {
             trustStorePassword = getKeyStorePassword();
@@ -1641,7 +1640,13 @@
             // not a file either, lastly try to locate this as a classpath resource
             if(url == null)
             {
-               ClassLoader loader = Thread.currentThread().getContextClassLoader();
+               ClassLoader loader = (ClassLoader) AccessController.doPrivileged( new PrivilegedAction()
+               {
+                  public Object run()
+                  {
+                     return Thread.currentThread().getContextClassLoader();
+                  }
+               });
                url = loader.getResource(storePath);
             }
          }




More information about the jboss-remoting-commits mailing list