@Override public void handleMarshallingException(final Throwable problem, final Object subject) { if (log.isDebugEnabled()) { TraceInformation.addUserInformation(problem, "toString = " + subject.toString()); } }
private String obtainEffectiveCacheName() { if (StringUtils.hasText(this.cacheName)) { if (this.logger.isDebugEnabled()) { this.logger.debug("Using custom cache name [" + this.cacheName + "]"); } return this.cacheName; } else { if (this.logger.isDebugEnabled()) { this.logger.debug("Using bean name [" + this.beanName + "] as cache name"); } return this.beanName; } }
@Override public void handleUnmarshallingException(final Throwable problem, final Class<?> subjectClass) { if (log.isDebugEnabled()) { StringBuilder builder = new StringBuilder(); ClassLoader cl = subjectClass.getClassLoader(); builder.append("classloader hierarchy:"); ClassLoader parent = cl; while (parent != null) { if (parent.equals(cl)) { builder.append("\n\t\t-> type classloader = ").append(parent); } else { builder.append("\n\t\t-> parent classloader = ").append(parent); } URL[] urls = getClassLoaderURLs(parent); if (urls != null) { for (URL u : urls) builder.append("\n\t\t->...").append(u); } parent = parent.getParent(); } TraceInformation.addUserInformation(problem, builder.toString()); } }
/** * Looks up the file, see : {@link DefaultFileLookup}. * * @param filename might be the name of the file (too look it up in the class path) or an url to a file. * @return an input stream to the file or null if nothing found through all lookup steps. * @throws FileNotFoundException if file cannot be found */ @Override public InputStream lookupFileStrict(String filename, ClassLoader cl) throws FileNotFoundException { InputStream is = filename == null || filename.length() == 0 ? null : getAsInputStreamFromClassLoader(filename, cl); if (is == null) { if (log.isDebugEnabled()) log.debugf("Unable to find file %s in classpath; searching for this file on the filesystem instead.", filename); return new FileInputStream(filename); } return is; }
public Features(ClassLoader classLoader) { features = new Properties(); try { Enumeration<URL> featureFiles = classLoader.getResources(FEATURES_FILE); while (featureFiles.hasMoreElements()) { URL url = featureFiles.nextElement(); try (InputStream is = url.openStream()) { features.load(is); } } if (log.isDebugEnabled()) { features.forEach((key, value) -> log.debugf("Feature %s=%s", key, value)); } } catch (IOException e) { log.debugf(e, "Error while attempting to obtain `%s` resources from the classpath", FEATURES_FILE); throw new CacheConfigurationException(e); } }