當前位置: 首頁>>代碼示例>>Java>>正文


Java Sasl.getSaslServerFactories方法代碼示例

本文整理匯總了Java中javax.security.sasl.Sasl.getSaslServerFactories方法的典型用法代碼示例。如果您正苦於以下問題:Java Sasl.getSaslServerFactories方法的具體用法?Java Sasl.getSaslServerFactories怎麽用?Java Sasl.getSaslServerFactories使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在javax.security.sasl.Sasl的用法示例。


在下文中一共展示了Sasl.getSaslServerFactories方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: refresh

import javax.security.sasl.Sasl; //導入方法依賴的package包/類
private void refresh() {
  final Enumeration<SaslServerFactory> factories = Sasl.getSaslServerFactories();
  final Map<String, List<SaslServerFactory>> map = Maps.newHashMap();

  while (factories.hasMoreElements()) {
    final SaslServerFactory factory = factories.nextElement();
    // Passing null so factory is populated with all possibilities.  Properties passed when
    // instantiating a server are what really matter. See createSaslServer.
    for (final String mechanismName : factory.getMechanismNames(null)) {
      if (!map.containsKey(mechanismName)) {
        map.put(mechanismName, new ArrayList<SaslServerFactory>());
      }
      map.get(mechanismName).add(factory);
    }
  }

  serverFactories = ImmutableMap.copyOf(map);
  if (logger.isDebugEnabled()) {
    logger.debug("Registered sasl server factories: {}", serverFactories.keySet());
  }
}
 
開發者ID:axbaretto,項目名稱:drill,代碼行數:22,代碼來源:FastSaslServerFactory.java

示例2: FastSaslServerFactory

import javax.security.sasl.Sasl; //導入方法依賴的package包/類
FastSaslServerFactory(Map<String,?> props) {
  final Enumeration<SaslServerFactory> factories =
      Sasl.getSaslServerFactories();
  while (factories.hasMoreElements()) {
    SaslServerFactory factory = factories.nextElement();
    for (String mech : factory.getMechanismNames(props)) {
      if (!factoryCache.containsKey(mech)) {
        factoryCache.put(mech, new ArrayList<SaslServerFactory>());
      }
      factoryCache.get(mech).add(factory);
    }
  }
}
 
開發者ID:nucypher,項目名稱:hadoop-oss,代碼行數:14,代碼來源:SaslRpcServer.java


注:本文中的javax.security.sasl.Sasl.getSaslServerFactories方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。