当前位置: 首页>>代码示例>>Java>>正文


Java Loader.getResourceOccurrenceCount方法代码示例

本文整理汇总了Java中ch.qos.logback.core.util.Loader.getResourceOccurrenceCount方法的典型用法代码示例。如果您正苦于以下问题:Java Loader.getResourceOccurrenceCount方法的具体用法?Java Loader.getResourceOccurrenceCount怎么用?Java Loader.getResourceOccurrenceCount使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ch.qos.logback.core.util.Loader的用法示例。


在下文中一共展示了Loader.getResourceOccurrenceCount方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: multiplicityWarning

import ch.qos.logback.core.util.Loader; //导入方法依赖的package包/类
private void multiplicityWarning(String resourceName, ClassLoader classLoader) {
    Set urlSet = null;
    StatusManager sm = this.loggerContext.getStatusManager();

    try {
        urlSet = Loader.getResourceOccurrenceCount(resourceName, classLoader);
    } catch (IOException var7) {
        sm.add(new ErrorStatus("Failed to get url list for resource [" + resourceName + "]", this.loggerContext, var7));
    }

    if (urlSet != null && urlSet.size() > 1) {
        sm.add(new WarnStatus("Resource [" + resourceName + "] occurs multiple times on the classpath.", this.loggerContext));
        Iterator i$ = urlSet.iterator();

        while (i$.hasNext()) {
            URL url = (URL) i$.next();
            sm.add(new WarnStatus("Resource [" + resourceName + "] occurs at [" + url.toString() + "]", this.loggerContext));
        }
    }

}
 
开发者ID:KonkerLabs,项目名称:konker-platform,代码行数:22,代码来源:KonkerContextInitializer.java

示例2: multiplicityWarning

import ch.qos.logback.core.util.Loader; //导入方法依赖的package包/类
private void multiplicityWarning(String resourceName, ClassLoader classLoader) {
  Set<URL> urlSet = null;
  StatusManager sm = loggerContext.getStatusManager();
  try {
    urlSet = Loader.getResourceOccurrenceCount(resourceName, classLoader);
  } catch (IOException e) {
    sm.add(new ErrorStatus("Failed to get url list for resource [" + resourceName + "]",
            loggerContext, e));
  }
  if (urlSet != null && urlSet.size() > 1) {
    sm.add(new WarnStatus("Resource [" + resourceName + "] occurs multiple times on the classpath.",
            loggerContext));
    for (URL url : urlSet) {
      sm.add(new WarnStatus("Resource [" + resourceName + "] occurs at [" + url.toString() + "]",
              loggerContext));
    }
  }
}
 
开发者ID:cscfa,项目名称:bartleby,代码行数:19,代码来源:ContextInitializer.java


注:本文中的ch.qos.logback.core.util.Loader.getResourceOccurrenceCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。