gpt4 book ai didi

org.projectodd.wunderboss.WunderBoss.classLoader()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-26 21:17:05 26 4
gpt4 key购买 nike

本文整理了Java中org.projectodd.wunderboss.WunderBoss.classLoader()方法的一些代码示例,展示了WunderBoss.classLoader()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WunderBoss.classLoader()方法的具体详情如下:
包路径:org.projectodd.wunderboss.WunderBoss
类名称:WunderBoss
方法名:classLoader

WunderBoss.classLoader介绍

暂无

代码示例

代码示例来源:origin: org.projectodd.wunderboss/wunderboss-clojure

@Override
public void initialize() {
  this.runtime = new LoaderWrapper(WunderBoss.classLoader());
  // we have to touch Clojure.class so it will init clojure enough for
  // binding the loader's root to work. Without this, we'll NPE
  Clojure.var("clojure.core", "require");
  // we have to bind the loader for cases where the TCCL is the wrong
  // module inside WildFly (this happens for web requests). If LOADER isn't
  // bound, clojure.lang.RT will fall back to the TCCL.
  Compiler.LOADER.bindRoot(WunderBoss.classLoader());
}

代码示例来源:origin: org.projectodd.wunderboss/wunderboss-core

protected void loadProperties() throws Exception {
  String internalPath = "META-INF/app.properties";
  log.debug("Looking for properties file at {}", internalPath);
  InputStream configStream = WunderBoss.classLoader().getResourceAsStream(internalPath);
  if (configStream != null) {
    log.debug("Found properties file {}", internalPath);
    properties.load(configStream);
  }
  Properties externalProperties = new Properties();
  String externalPath = jarURL().getPath();
  if (externalPath.endsWith(".jar")) {
    externalPath = externalPath.replace(".jar", ".properties");
    log.debug("Looking for properties file at {}", externalPath);
    File externalFile = new File(externalPath);
    if (externalFile.exists()) {
      log.debug("Found properties file {}", externalPath);
      externalProperties.load(new FileInputStream(externalFile));
      properties.putAll(externalProperties);
    }
  }
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com