-
1. Re: How can persist JCA Mbean's attributes using Persistenc
peterj Dec 17, 2008 11:29 AM (in response to makas)Why would you want to persist the attributes for those beans? What do you think that will buy you? What is the use case for this?
-
2. Re: How can persist JCA Mbean's attributes using Persistenc
makas Dec 18, 2008 5:20 AM (in response to makas)Sorry for cross-port.
Persistence of the attributes is necessary to I have a possibility to edit JCA connector's parameters and that after reboot JBoss this changes remained.
I think to do this something like this http://www.jboss.org/community/docs/DOC-12775.
But, when I specifi the DelegatingPersistenceManager in jboss-service.xml descriptor<mbean code="org.jboss.resource.connectionmanager.ConnectionFactoryBindingService" name="jboss.jca:name=Aurora/baxi/green/maxi,service=ConnectionFactoryBinding" xmbean-dd=""> <description>PersistentServiceExample</description> <descriptors> <persistence persistPolicy="OnUpdate"/> <persistence-manager value="org.jboss.mx.persistence.DelegatingPersistenceManager"/> <descriptor name="attribute-persistence-operation" value="apmCreate"></descriptor> </descriptors> <class>org.jboss.resource.connectionmanager.ConnectionFactoryBindingService</class> <!-- Attributes --> <attribute access="read-write" getMethod="getJndiName" setMethod="setJndiName"> <name>JndiName</name> <type>java.lang.String</type> </attribute> </mbean>
I catch MBeanRegistrationException which reports that this bean has been registered.
How can I say that JBoss will not regist new MBean and persist needed Mbean? -
3. Re: How can persist JCA Mbean's attributes using Persistenc
peterj Dec 18, 2008 10:52 AM (in response to makas)If you have created a *-service.xml file that deploys the the four mbeans created from *-ds.xml, then you could simply remove the *-ds.xml file. Note that your *-service.xml must contain all four mbeans, not just the one whose attributes you want to persist.
Caveat: I do not claim that the above will work, I have never tried it. -
4. Re: How can persist JCA Mbean's attributes using Persistenc
makas Dec 19, 2008 9:20 AM (in response to makas)I can't remove -ds.xml. Access for -ds.xml is banned for me.
I can create new JMX service that contain in attributes needed JCA MBEAn's attributers, and persist it. When Service is started, I give persistence data and set up it in JCA MBeans.(past this logic in startService() method )public class SimpleMBeanIMpl extends ServiceMBeanSupport implements SimpleMBean { private List<AtributesClass> data; protected void startService(){ //set up JCa MBeans Attributes } public setData(...){ ...} public getData(){ ...} }
Do you know how is it possible to edit Jca MBean's attributes and restore them after reloading without PersitentManager and more simple than I ? -
5. Re: How can persist JCA Mbean's attributes using Persistenc
peterj Dec 19, 2008 12:28 PM (in response to makas)If the properties whose values you want to persist are read/write, then you could create your own MBean to read and persist the properties, and then reset the properties on a restart. Have your MBean depend on the data source MBean so that it is started in the correct order.
-
6. Re: How can persist JCA Mbean's attributes using Persistenc
makas Dec 22, 2008 4:14 AM (in response to makas)>Have your MBean depend on the data source MBean so that it is started in the correct order?
Yes, i have. First of all starts deploy of JCA Connectors and initialization of JCA Mbeans, after that initializes my MBean and starts my service.