Author: ron.sigal(a)jboss.com
Date: 2008-03-26 00:31:59 -0400 (Wed, 26 Mar 2008)
New Revision: 3766
Modified:
remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java
Log:
JBREM-934: Put System.getProperty() in AccessController.doPrivileged() call.
Modified: remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java
===================================================================
--- remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java 2008-03-26
04:30:55 UTC (rev 3765)
+++ remoting2/branches/2.x/src/main/org/jboss/remoting/ident/Identity.java 2008-03-26
04:31:59 UTC (rev 3766)
@@ -21,7 +21,6 @@
*/
package org.jboss.remoting.ident;
-import org.jboss.remoting.loading.ClassByteClassLoader;
import org.jboss.remoting.network.NetworkRegistry;
import javax.management.MBeanServer;
@@ -55,7 +54,26 @@
private static transient Random random = new Random(System.currentTimeMillis());
public static transient String DEFAULT_DOMAIN = "JBOSS";
- private static transient String _domain =
System.getProperty("jboss.identity.domain", DEFAULT_DOMAIN);
+ private static transient String _domain = DEFAULT_DOMAIN;
+
+ static
+ {
+ try
+ {
+ _domain = (String)AccessController.doPrivileged( new
PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return System.getProperty("jboss.identity.domain",
DEFAULT_DOMAIN);
+ }
+ });
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ }
+
private static transient Map identities = new WeakHashMap(2);
private final String instanceid;
@@ -275,7 +293,22 @@
if(file == null)
{
// we may not have that mbean, which is OK
- String fl = System.getProperty("jboss.identity.dir", ".");
+ String fl = ".";
+ try
+ {
+ fl = (String)AccessController.doPrivileged( new PrivilegedExceptionAction()
+ {
+ public Object run() throws Exception
+ {
+ return System.getProperty("jboss.identity.dir",
".");
+ }
+ });
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
File dir = new File(fl);
if(dir.exists() == false)
{