JDK-5108724 : Add support for persistence to JMX API
  • Type: Enhancement
  • Component: core-svc
  • Sub-Component: javax.management
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic
  • CPU: generic
  • Submitted: 2004-09-29
  • Updated: 2008-09-17
  • Resolved: 2008-09-17
Related Reports
Relates :  
Relates :  
Description
The JMX API could be extended to have standard support for persistence.  Currently, the support is rudimentary, and consists of optional support in Model MBeans for load() and store() methods.  The way these methods work is not specified, and the Reference Implementation does not include this optional functionality.

A couple of possibilities exist in this area:

(1) Provide a way to take a snapshot of all MBeans or some subset of MBeans in an MBean Server and write it to a file, in such a way that the MBeans can be recreated subsequently.  One possibility would be to use MLets here.  The file written out could be an MLet text file that when given to the MLet service would reconstruct the MBeans.  The constructor parameters for each MBean in the MLet file could contain the information needed to reconstruct, and/or the MLet format could be extended to allow additional operations like setAttribute calls to be specified on reconstruction.

(2) Provide a way to define an MBean that is backed by an XML configuration file.  Each configuration item in the file is translated into an attribute of the same name and appropriate type in the MBean.  Reading the attribute reflects the value currently stored in the file.  Writing the attribute updates the file, or perhaps there need to be explicit load() and save() operations (already defined by the PersistentMBean interface) to cause the file to be read or written.

Comments
EVALUATION This is a nice idea in theory but either excessively complicated or insufficiently powerful in practice. For the specific question of individual MBeans backed by persistent storage, see e.g. <http://weblogs.java.net/blog/emcmanus/archive/2006/11/a_real_example.html>.
17-09-2008

EVALUATION Not current planned for JMX 2.0 (and therefore Java SE 7).
24-01-2008

PUBLIC COMMENTS .
30-09-2004

EVALUATION Seems like an obviously good idea. Not sure if we will be able to do it for Mustang though. ###@###.### 2004-09-29
29-09-2004