src/share/classes/sun/security/krb5/SCDynamicStoreConfig.java

Print this page




  25 
  26 package sun.security.krb5;
  27 
  28 import java.io.IOException;
  29 import java.util.Collection;
  30 import java.util.Hashtable;
  31 import java.util.Vector;
  32 
  33 
  34 public class SCDynamicStoreConfig {
  35     private static native void installNotificationCallback();
  36     private static native Hashtable<String, Object> getKerberosConfig();
  37     private static boolean DEBUG = sun.security.krb5.internal.Krb5.DEBUG;
  38 
  39     static {
  40         boolean isMac = java.security.AccessController.doPrivileged(
  41             new java.security.PrivilegedAction<Boolean>() {
  42                 public Boolean run() {
  43                     String osname = System.getProperty("os.name");
  44                     if (osname.contains("OS X")) {
  45                         System.loadLibrary("osx");
  46                         return true;
  47                     }
  48                     return false;
  49                 }
  50             });
  51         if (isMac) installNotificationCallback();
  52     }
  53 
  54     private static Vector<String> unwrapHost(
  55             Collection<Hashtable<String, String>> c) {
  56         Vector<String> vector = new Vector<String>();
  57         for (Hashtable<String, String> m : c) {
  58             vector.add(m.get("host"));
  59         }
  60         return vector;
  61     }
  62 
  63     /**
  64      * convertRealmConfigs: Maps the Object graph that we get from JNI to the
  65      * object graph that Config expects. Also the items inside the kdc array




  25 
  26 package sun.security.krb5;
  27 
  28 import java.io.IOException;
  29 import java.util.Collection;
  30 import java.util.Hashtable;
  31 import java.util.Vector;
  32 
  33 
  34 public class SCDynamicStoreConfig {
  35     private static native void installNotificationCallback();
  36     private static native Hashtable<String, Object> getKerberosConfig();
  37     private static boolean DEBUG = sun.security.krb5.internal.Krb5.DEBUG;
  38 
  39     static {
  40         boolean isMac = java.security.AccessController.doPrivileged(
  41             new java.security.PrivilegedAction<Boolean>() {
  42                 public Boolean run() {
  43                     String osname = System.getProperty("os.name");
  44                     if (osname.contains("OS X")) {
  45                         System.loadLibrary("osxkrb5");
  46                         return true;
  47                     }
  48                     return false;
  49                 }
  50             });
  51         if (isMac) installNotificationCallback();
  52     }
  53 
  54     private static Vector<String> unwrapHost(
  55             Collection<Hashtable<String, String>> c) {
  56         Vector<String> vector = new Vector<String>();
  57         for (Hashtable<String, String> m : c) {
  58             vector.add(m.get("host"));
  59         }
  60         return vector;
  61     }
  62 
  63     /**
  64      * convertRealmConfigs: Maps the Object graph that we get from JNI to the
  65      * object graph that Config expects. Also the items inside the kdc array