[jboss-user] [Installation, Configuration & Deployment] - Map type attribute for an XMBean

bossy do-not-reply at jboss.com
Wed Nov 8 08:35:08 EST 2006

I want to include an attribute to an XMBean that is of type Map. I need to store in it key/value pairs. I have a class called ConfigXMBean with methods public Map getMyMapProperty() and public void setMyMapProperty(Map prop). In my config-xmbean.xml file I have the following description:
<attribute access="read-write" getMethod="getMyMapProperty" setMethod="setMyMapProperty">
  |       <description>My Map Property </description>
  |       <name>setMyMapProperty</name>
  |       <type>java.util.Map</type>
  |    </attribute>

I also have the following persistence descriptor for this mbean:
  |       <persistence persistPolicy="OnUpdate"
  |          persistPeriod="10"
  |          persistLocation="${jboss.server.data.dir}"
  |          persistName="JNDIMap.ser"/>
  |       <currencyTimeLimit value="10"/>
  |       <state-action-on-update value="keep-running"/>
  |       <persistence-manager value="org.jboss.mx.persistence.ObjectStreamPersistenceManager" />
  |    </descriptors>

The problem is when I change the value of this property by adding an item, it doesn't persist the property -  that is when I restart JBoss I loose the item I added before.

My questions are:
 - is it possible to have a Map attribute for an MBean, 
 - if Yes - is it possible to persist it the way I'm trying to do it or am I missing something?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3984137#3984137

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3984137

More information about the jboss-user mailing list