src/share/classes/sun/rmi/transport/tcp/TCPEndpoint.java
Print this page
@@ -36,10 +36,11 @@
import java.rmi.RemoteException;
import java.rmi.server.RMIClientSocketFactory;
import java.rmi.server.RMIServerSocketFactory;
import java.rmi.server.RMISocketFactory;
import java.security.AccessController;
+import java.security.PrivilegedAction;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Map;
@@ -48,13 +49,10 @@
import sun.rmi.runtime.NewThreadAction;
import sun.rmi.transport.Channel;
import sun.rmi.transport.Endpoint;
import sun.rmi.transport.Target;
import sun.rmi.transport.Transport;
-import sun.security.action.GetBooleanAction;
-import sun.security.action.GetIntegerAction;
-import sun.security.action.GetPropertyAction;
/**
* TCPEndpoint represents some communication endpoint for an address
* space (VM).
*
@@ -80,24 +78,26 @@
/** true if real local host name is known yet */
private static boolean localHostKnown;
// this should be a *private* method since it is privileged
private static int getInt(String name, int def) {
- return AccessController.doPrivileged(new GetIntegerAction(name, def));
+ return AccessController.doPrivileged(
+ (PrivilegedAction<Integer>) () -> Integer.getInteger(name, def));
}
// this should be a *private* method since it is privileged
private static boolean getBoolean(String name) {
- return AccessController.doPrivileged(new GetBooleanAction(name));
+ return AccessController.doPrivileged(
+ (PrivilegedAction<Boolean>) () -> Boolean.getBoolean(name));
}
/**
* Returns the value of the java.rmi.server.hostname property.
*/
private static String getHostnameProperty() {
return AccessController.doPrivileged(
- new GetPropertyAction("java.rmi.server.hostname"));
+ (PrivilegedAction<String>) () -> System.getProperty("java.rmi.server.hostname"));
}
/**
* Find host name of local machine. Property "java.rmi.server.hostname"
* is used if set, so server administrator can compensate for the possible