home *** CD-ROM | disk | FTP | other *** search
- package sun.net;
-
- import java.security.AccessController;
- import sun.security.action.GetIntegerAction;
-
- public final class InetAddressCachePolicy {
- private static final String cachePolicyProp = "sun.net.inetaddr.ttl";
- public static final int FOREVER = -1;
- public static final int NEVER = 0;
- private static int cachePolicy;
- private static boolean set = false;
-
- public static synchronized int get() {
- return cachePolicy;
- }
-
- public static synchronized void setIfNotSet(int var0) {
- if (!set) {
- if (var0 > cachePolicy || var0 < -1) {
- throw new SecurityException("can't make InetAddress cache more lax");
- }
-
- cachePolicy = var0;
- }
-
- }
-
- static {
- Integer var0 = (Integer)AccessController.doPrivileged(new GetIntegerAction("sun.net.inetaddr.ttl"));
- if (var0 == null) {
- var0 = new Integer(-1);
- set = false;
- } else {
- set = true;
- }
-
- cachePolicy = var0;
- }
- }
-