Class GlobalBundleCache


  • class GlobalBundleCache
    extends java.lang.Object
    Global cache of translation bundles.

    Every translation bundle will be cached here when it gets loaded for the first time from a thread. Another lookup for the same translation bundle (same locale and type) from the same or a different thread will return the cached one.

    Note that NLS instances maintain per-thread Map of loaded translation bundles. Once a thread accesses a translation bundle it will keep reference to it and will not call lookupBundle(Locale, Class) again for the same translation bundle as long as its locale doesn't change.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Map<java.util.Locale,​java.util.Map<java.lang.Class,​TranslationBundle>> cachedBundles  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static void clear()  
      (package private) static <T extends TranslationBundle>
      T
      lookupBundle​(java.util.Locale locale, java.lang.Class<T> type)
      Looks up for a translation bundle in the global cache.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • cachedBundles

        private static final java.util.Map<java.util.Locale,​java.util.Map<java.lang.Class,​TranslationBundle>> cachedBundles
    • Constructor Detail

      • GlobalBundleCache

        GlobalBundleCache()