This patch provides a mechanism for specifying an
XMBean Persistence Manager via the XMBean data
descriptor. Although most of the needed infrastructure
was there, a few modifications needed to be made to
make this work.
1) added parsing of data descriptor for a new
persistence-manager attribute
2) as a result of parsing, this (String) value is added to
the XMBean's info as a descriptor
3) at preRegister(), the XMBean (ModelMBeanInvoker)
uses this descriptor value to create a new
PersistenceManager instance, which is used from then
on as the persistence engine
4) added a needed callback reference to the mbean in
the load method of PersistenceManager
5) modified XMBean descriptor (XML) parsing routine
(slightly) to allow "jar" URL's.
Since this is my first submission to the project, I tried to
keep my modifications to the bare minimum.
Nonetheless, this patch should allow for anyone to "get
going" with XMBean persistence, either by using the
persistence engine provided, or rolling their own. Future
directions could include an XML-based persistence
manager, that could reuse the code (JavaBean
PropertyEditor-based) common to service descriptor
loading and the JMX console. It also might be
interesting to share one PersistenceManager instance
between several MBeans, reducing memory overhead.
This might be accomplished by making the persistence
manager an MBean itself.
Rather than sitting on this patch any longer, I decided to
submit it before writing unit tests. If I get a chance, I'll
try to write and submit some, but it might be a while.
Please contact me if revisions / clarification are required.
- Matt Munz
mmunz@apelon.com
Apelon, Inc.
XMBean Persistence Patch and Examples Archive