Hi,

On 16.03.2010 17:14, Valentin Valchev (JIRA) wrote:
> Valentin Valchev updated FELIX-2206:
> ------------------------------------
> So there are few possibilities:
> 1. A dirty hack, when OsgiManager creates the ConfigurationRender calls a 
> method, to *set* the resourceBundleManager.

See below.

> 2. Make resource bundle manager accessible to all plugins as a request 
> parameter. This will also require to make the ResourceBundleManager class 
> public... or define the following interface in the public API:
> interface ResourceBundleManager {
>  public ResourceBundle getResourceBundle( final Bundle provider, final Locale 
> locale )
> }

I am not so sure, whether we should make this API public. Even though
once in a while I thought it would be useful to have the
ResourceBundleManager available, I always found a way to not need it...

> 3. Refactor the Bundles & Services plugins, and change the title to 
> respectively %Bundles and %Services. This is another dirty hack but the 
> titles will be shown correctly.

This was an approach I chose in one of my prototype plugins. But I fear,
there a number of plugins out in the wild, which will not want to do
that (or cannot)...

> 4. Refactor the Bundles & Services plugins and extract the configuration 
> printer code in a separate class. In this case no localization will be 
> supported for these printers - just like other ones. I want to remind again, 
> that we choose that no localization is required for Configuration Status as 
> the provided information is more for diagnostics and is better to remain 
> not-localized.

This would be an option, too. Again, this may collide with plugins
existing in the wild.

I fear the cause of this problem is that we defined both the
AbstractWebConsolePlugin and the ConfigurationPrinter to have a
getTitle() method.

For the AbstractWebConsolePlugin, the problem is solved by the
OsgiManager. For the ConfigurationPrinter, the problem would have to be
solved in the ConfigurationRender.

In a sense the ConfigurationRender and the OsgiManager are comparable:
Both manage a collection of plugins and control there execution. So,
maybe your option 1. (adding the ResourceBundleManager to the
ConfigurationRender) is not wrong.

We could make the ConfigurationRender plugin a special plugin, which is
instantiated in a special way be the OsgiManager by explicitly calling
the constructor taking the ResourceBundleManager. This allows for the
ConfigurationRender class to localize its plugins (the
ConfigurationPrinter services); if only to localize them to English.

WDYT ?

Regards
Felix

Reply via email to