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.
| Modifier and Type | Field and Description |
|---|---|
| private static final Map |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static void | |
| pack-priv static synchronized < required bundle type T extends TranslationBundle> T | Returns: an instance of the required bundle typethe preferred locale locale, Class<T> required bundle type type)Looks up for a translation bundle in the global cache. |
| cachedBundles | back to summary |
|---|---|
| private static final Map<Locale, Map<Class<T>, TranslationBundle>> cachedBundles | |
| GlobalBundleCache | back to summary |
|---|---|
| pack-priv GlobalBundleCache() | |
| clear | back to summary |
|---|---|
| pack-priv static void clear() | |
| lookupBundle | back to summary |
|---|---|
| pack-priv static synchronized <T extends TranslationBundle> T lookupBundle(Locale locale, Class<T> type) Looks up for a translation bundle in the global cache. If found returns the cached bundle. If not found creates a new instance puts it into the cache and returns it.
| |