JDK-5072267 : Should have a way to communicate client locale to server
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6,7
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-07-08
  • Updated: 2017-05-16
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
7 b41Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Relates :  
Relates :  
Relates :  
There should be a way for the remote client to communicate information such as its locale to the server.  MBeans remotely invoked by the client should be able to discover this locale, for example to return localized text in MBeanInfo descriptions or as the result of operations.  The locale or other information should be available in a well-known ThreadLocal variable or a variable of a class that wraps a ThreadLocal.  Currently the only (hacky) way to achieve this is to arrange for the locale to be encoded in a Principal within the authenticated Subject for the connection.

EVALUATION The plan is to introduce a new namespace once namespace functionality is available. If you access the MBean "javax.management.context//locale=fr_FR//d:k=v", then it is the same as accessing plain d:k=v, except that the key "locale" is associated with the value "fr_FR" in a Map<String, String> that is available to MBeans being accessed. This mechanism is much more general than just locales, and could be used for example to communicate a transaction id or any other information from the client to the server.

WORK AROUND As of Mustang it is possible to localize descriptions in the *client* if the server has added appropriate descriptionResourceKey and descriptionResourceBundleBaseName fields in the Descriptor for the MBean. This means that the client must have resource bundles containing the localized descriptions, so this will not work out-of-the-box for generic clients such as jconsole.

PUBLIC COMMENTS A remote JMX client should be able to communicate its locale to the server so that, e.g., the server can localize the descriptions in MBeanInfo.