Class ResourceBundleManager
- java.lang.Object
-
- org.apache.felix.webconsole.internal.i18n.ResourceBundleManager
-
- All Implemented Interfaces:
EventListener,org.osgi.framework.BundleListener
public class ResourceBundleManager extends Object implements org.osgi.framework.BundleListener
The ResourceBundleManager manages resource bundle instance per OSGi Bundle. It contains a local cache, for bundles, but when a bundle is being unistalled, its resources stored in the cache are cleaned up.
-
-
Constructor Summary
Constructors Constructor Description ResourceBundleManager(org.osgi.framework.BundleContext bundleContext)Creates a new object and adds self as a bundle listener
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbundleChanged(org.osgi.framework.BundleEvent event)voiddispose()Removes the bundle lister.ResourceBundlegetResourceBundle(org.osgi.framework.Bundle provider, Locale locale)This method is used to retrieve a /cached/ instance of the i18n resource associated with a given bundle.
-
-
-
Method Detail
-
dispose
public void dispose()
Removes the bundle lister.
-
getResourceBundle
public ResourceBundle getResourceBundle(org.osgi.framework.Bundle provider, Locale locale)
This method is used to retrieve a /cached/ instance of the i18n resource associated with a given bundle.- Parameters:
provider- the bundle, provider of the resourceslocale- the requested locale.- Returns:
- the resource bundle - if not bundle with the requested locale exists, the default locale is used.
-
bundleChanged
public final void bundleChanged(org.osgi.framework.BundleEvent event)
- Specified by:
bundleChangedin interfaceorg.osgi.framework.BundleListener- See Also:
BundleListener.bundleChanged(org.osgi.framework.BundleEvent)
-
-