Example usage for org.apache.zookeeper.server.util KerberosUtil getDefaultRealm

List of usage examples for org.apache.zookeeper.server.util KerberosUtil getDefaultRealm

Introduction

In this page you can find the example usage for org.apache.zookeeper.server.util KerberosUtil getDefaultRealm.

Prototype

public static String getDefaultRealm() throws IllegalArgumentException 

Source Link

Usage

From source file:com.streamsets.datacollector.security.HadoopSecurityUtil.java

License:Apache License

public static String getDefaultRealm() throws ReflectiveOperationException {
    AccessControlContext accessContext = AccessController.getContext();
    synchronized (SecurityUtil.getSubjectDomainLock(accessContext)) {
        return KerberosUtil.getDefaultRealm();
    }/*from   ww  w .  java 2 s  .  com*/
}

From source file:org.apache.hoya.tools.HoyaUtils.java

License:Apache License

public static String getKerberosRealm() {
    try {/*from  w w  w  .j av  a2 s .  c  o  m*/
        return KerberosUtil.getDefaultRealm();
    } catch (Exception e) {
        log.debug("introspection into JVM internals failed", e);
        return "(unknown)";

    }
}