本文整理汇总了Java中org.jasig.cas.support.spnego.util.ReverseDNSRunnable类的典型用法代码示例。如果您正苦于以下问题:Java ReverseDNSRunnable类的具体用法?Java ReverseDNSRunnable怎么用?Java ReverseDNSRunnable使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReverseDNSRunnable类属于org.jasig.cas.support.spnego.util包,在下文中一共展示了ReverseDNSRunnable类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRemoteHostName
import org.jasig.cas.support.spnego.util.ReverseDNSRunnable; //导入依赖的package包/类
/**
* Convenience method to perform a reverse DNS lookup. Threads the request
* through a custom Runnable class in order to prevent inordinately long
* user waits while performing reverse lookup.
* @param remoteIp the remote ip
* @return the remote host name
*/
protected String getRemoteHostName(final String remoteIp) {
final ReverseDNSRunnable revDNS = new ReverseDNSRunnable(remoteIp);
final Thread t = new Thread(revDNS);
t.start();
try {
t.join(this.timeout);
} catch (final InterruptedException e) {
logger.debug("Threaded lookup failed. Defaulting to IP {}.", remoteIp, e);
}
final String remoteHostName = revDNS.get();
logger.debug("Found remote host name {}.", remoteHostName);
return StringUtils.isNotEmpty(remoteHostName) ? remoteHostName : remoteIp;
}
开发者ID:hsj-xiaokang,项目名称:springboot-shiro-cas-mybatis,代码行数:25,代码来源:BaseSpnegoKnownClientSystemsFilterAction.java