private InputStream loadPluginResource(String iconRef) { InputStream answer = Thread.currentThread().getContextClassLoader().getResourceAsStream(iconRef); if (answer == null) { answer = getContext().getProjectClassLoaders().getCompileClassLoader().getResourceAsStream(iconRef); } if (answer == null) { answer = this.getClass().getResourceAsStream(iconRef); } return answer; }
protected int getPort() { final Properties properties = ThorntailUtil.getThorntailProperties(getContext().getProjectClassLoaders().getCompileClassLoader()); properties.putAll(System.getProperties()); if (properties.containsKey("thorntail.http.port")) { return Integer.parseInt((String) properties.get("thorntail.http.port")); } return Configs.asInt(getConfig(Config.port)); }
protected Probe discoverSpringBootHealthCheck(Integer initialDelay, Integer period, Integer timeout, Integer failureTh, Integer successTh) { try { if (getContext().getProjectClassLoaders().isClassInCompileClasspath(true, REQUIRED_CLASSES)) { Properties properties = SpringBootUtil.getSpringBootApplicationProperties(getContext().getProjectClassLoaders().getCompileClassLoader()); return buildProbe(properties, initialDelay, period, timeout, failureTh, successTh); } } catch (Exception ex) { log.error("Error while reading the spring-boot configuration", ex); } return null; }