/** * Removes the bundle from any cached "misses" */ public static void clearBundle(final String bundleName) { bundlesMap.remove(getCurrentThreadContextClassLoader().hashCode() + bundleName); }
/** * Sets a {@link ClassLoader} to look up the bundle from if none can be found on the current thread's classloader */ public static void setDelegatedClassLoader(final ClassLoader classLoader) { synchronized (bundlesMap) { delegatedClassLoaderMap.put(getCurrentThreadContextClassLoader().hashCode(), classLoader); } }
/** * Clears the internal list of resource bundles. */ public static void clearDefaultResourceBundles() { ClassLoader ccl = getCurrentThreadContextClassLoader(); List<String> bundles = new ArrayList<String>(); classLoaderMap.put(ccl.hashCode(), bundles); bundles.add(0, XWORK_MESSAGES_BUNDLE); }
/** * Add's the bundle to the internal list of default bundles. * <p/> * If the bundle already exists in the list it will be readded. * * @param resourceBundleName the name of the bundle to add. */ public static void addDefaultResourceBundle(String resourceBundleName) { //make sure this doesn't get added more than once ClassLoader ccl; synchronized (XWORK_MESSAGES_BUNDLE) { ccl = getCurrentThreadContextClassLoader(); List<String> bundles = classLoaderMap.get(ccl.hashCode()); if (bundles == null) { bundles = new ArrayList<String>(); classLoaderMap.put(ccl.hashCode(), bundles); bundles.add(XWORK_MESSAGES_BUNDLE); } bundles.remove(resourceBundleName); bundles.add(0, resourceBundleName); } if (LOG.isDebugEnabled()) { LOG.debug("Added default resource bundle '{}' to default resource bundles for the following classloader '{}'", resourceBundleName, ccl.toString()); } }
ClassLoader classLoader = getCurrentThreadContextClassLoader(); String key = createMissesKey(String.valueOf(classLoader.hashCode()), aBundleName, locale);
private static void clearTomcatCache() { ClassLoader loader = getCurrentThreadContextClassLoader();