Author: ron.sigal(a)jboss.com
Date: 2008-03-26 01:26:59 -0400 (Wed, 26 Mar 2008)
New Revision: 3774
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java
Log:
JBREM-934: Put Class.getMethod() in AccessController.doPrivileged() call.
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-03-26
05:26:30 UTC (rev 3773)
+++
remoting2/branches/2.x/src/main/org/jboss/remoting/security/SSLSocketBuilder.java 2008-03-26
05:26:59 UTC (rev 3774)
@@ -49,6 +49,8 @@
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.security.PrivilegedAction;
+import java.security.PrivilegedActionException;
+import java.security.PrivilegedExceptionAction;
import java.security.Provider;
import java.security.SecureRandom;
import java.security.UnrecoverableKeyException;
@@ -399,8 +401,24 @@
{
try
{
- Class sfClass = ClassLoaderUtility.loadClass(defaultFactoryName,
SSLSocketBuilder.class);
- Method m = sfClass.getMethod("getDefault", null);
+ final Class sfClass = ClassLoaderUtility.loadClass(defaultFactoryName,
SSLSocketBuilder.class);
+ Method m =null;
+
+ try
+ {
+ m = (Method)AccessController.doPrivileged( new
PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return sfClass.getMethod("getDefault", null);
+ }
+ });
+ }
+ catch (PrivilegedActionException e)
+ {
+ throw (Exception) e.getCause();
+ }
+
if (m == null)
{
throw new RuntimeException(