public static BootstrapLogger logger(String name) { synchronized (LOGGERS) { BootstrapLogger logger = LOGGERS.get(name); if (logger == null) { logger = new BootstrapLogger(name); LOGGERS.put(name, logger); } return logger; } }
public void debug(Object message) { getBackingLogger().debug(message); }
public String toString() { return "[" + this.name + ": " + this.getLevel() + "]"; }
protected void handleWildFlySwarmBootstrapConf(ModuleSpec.Builder builder) throws IOException { if (LOG.isTraceEnabled()) { LOG.trace("Loading conf from " + WildFlySwarmBootstrapConf.CLASSPATH_LOCATION); } InputStream bootstrapTxt = getClass().getClassLoader().getResourceAsStream(WildFlySwarmBootstrapConf.CLASSPATH_LOCATION); if (bootstrapTxt != null) { WildFlySwarmBootstrapConf conf = new WildFlySwarmBootstrapConf(bootstrapTxt); conf.apply(builder); } } }
if (LOG.isDebugEnabled()) { LOG.debug(bootstrapOperations);
public RuntimeServer() { try { Module loggingModule = Module.getBootModuleLoader().loadModule(ModuleIdentifier.create("org.wildfly.swarm.logging", "runtime")); ClassLoader originalCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(loggingModule.getClassLoader()); System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager"); System.setProperty("org.jboss.logmanager.configurator", LoggingConfigurator.class.getName()); //force logging init LogManager.getLogManager(); BootstrapLogger.setBackingLoggerManager(new JBossLoggingManager()); } finally { Thread.currentThread().setContextClassLoader(originalCl); } } catch (ModuleLoadException e) { System.err.println("[WARN] logging not available, logging will not be configured"); } }
public static String downloadTimestampVersion(String artifact, String metadataSrc) throws IOException, XPathExpressionException { final URL url = new URL(metadataSrc); final URLConnection connection = MavenSettings.getSettings().openConnection(url); boolean message = Boolean.getBoolean("maven.download.message"); try (InputStream is = connection.getInputStream()) { if (message) { LOGGER.trace("Downloading maven-metadata.xml for " + artifact); } return snapshotVersionXpath.evaluate(new InputSource(is)); } }
void apply(ModuleSpec.Builder builder, MavenArtifactDescriptor entry) throws IOException { File artifact = MavenResolvers.get().resolveJarArtifact(entry.mscCoordinates()); if (artifact == null) { throw new IOException("Unable to locate artifact: " + entry.mscGav()); } if (LOG.isTraceEnabled()) { LOG.trace("adding bootstrap artifact: " + artifact.getAbsolutePath()); } builder.addResourceRoot( ResourceLoaderSpec.createResourceLoaderSpec( ResourceLoaders.createJarResourceLoader(artifact.getName(), new JarFile(artifact)) ) ); }
if (LOG.isDebugEnabled()) { LOG.debug(bootstrapOperations);
@SuppressWarnings("unused") public RuntimeServer() { try { Module loggingModule = Module.getBootModuleLoader().loadModule(ModuleIdentifier.create("org.wildfly.swarm.logging", "runtime")); ClassLoader originalCl = Thread.currentThread().getContextClassLoader(); try { Thread.currentThread().setContextClassLoader(loggingModule.getClassLoader()); System.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager"); System.setProperty("org.jboss.logmanager.configurator", LoggingConfigurator.class.getName()); //force logging init LogManager.getLogManager(); BootstrapLogger.setBackingLoggerManager(new JBossLoggingManager()); } finally { Thread.currentThread().setContextClassLoader(originalCl); } } catch (ModuleLoadException e) { System.err.println("[WARN] logging not available, logging will not be configured"); } }
public static void downloadFile(String artifact, String src, File dest) throws IOException { if (dest.exists()) { return; } final URL url = new URL(src); final URLConnection connection = MavenSettings.getSettings().openConnection(url); boolean message = Boolean.getBoolean("maven.download.message"); try (InputStream bis = connection.getInputStream()) { dest.getParentFile().mkdirs(); if (message) { LOGGER.trace("Downloading " + artifact); } Files.copy(bis, dest.toPath(), StandardCopyOption.REPLACE_EXISTING); } }
final String path = "modules/" + identifier.getName().replace('.', '/') + "/" + identifier.getSlot() + "/module.xml"; if (LOG.isTraceEnabled()) { LOG.trace("attempt:" + identifier); if (LOG.isTraceEnabled()) { LOG.trace("classloader: " + cl); LOG.trace("path: " + path); if (LOG.isTraceEnabled()) { LOG.trace("not found: " + identifier); if (LOG.isTraceEnabled()) { LOG.trace("base of " + identifier + ": " + base);
public void trace(Object message) { getBackingLogger().trace(message); }
try { if (Layout.getInstance().isUberJar()) { if (LOG.isDebugEnabled()) { LOG.debug("Loading as uberjar"); if (LOG.isDebugEnabled()) { LOG.debug("Loading as non-ubjerjar");
BootstrapLogger.setBackingLoggerManager((BackingLoggerManager) logManagerClass.newInstance()); } finally { Thread.currentThread().setContextClassLoader(originalCl);
public static BootstrapLogger logger(String name) { synchronized (LOGGERS) { BootstrapLogger logger = LOGGERS.get(name); if (logger == null) { logger = new BootstrapLogger(name); LOGGERS.put(name, logger); } return logger; } }
public String toString() { return "[" + this.name + ": " + this.getLevel() + "]"; }