xmbean as service... and two more questions
vitor_b Feb 26, 2007 9:32 AMHello
I have a few questions, not very hard i think. So lets look at them:
1.
I have created my first xmbean, lets say 'MyService'. This bean extends class 'ServiceMBeanSupport'. I have generated MyService.xml file, and it looks ok. I haven't generated interface 'MyServiceMBean' for my xmbean.
I think i don't need it. My xmbean for now has only a few attributes and operations, and these operations work fine.
The problem is that when deploying xmbean methods like createService(), startService() are not called.
This is strange for me. What is wrong with my xmbean?
In contrary i can create common mbean which implements interface for bean, then remove from my jboss-service.xml file line
xmbean-dd="home/jmx/beans/MyService.xml"
and methods like startService() are called.
Any suggestions what is wrong with my xmbean?
My methods createService(), startService() do nothing atm, example:
protected void startService() throws Exception { log.info("startService()"); }
2. generating jboss-service.xml
My ant task looks like that atm:
<target name="xdoclet-jmx-deploy" depends="create-folders" > <jmxdoclet mergeDir="${merge-dir}" excludedTags="@version,@autor,@todo" destDir="${res-service-dir}/META-INF" verbose="true" addedTags="@xdoclet-generated at ${TODAY},@copyright The XDoclet Team,@author XDoclet,@version ${version}"> <fileset dir="src" includes="home/jmx/beans/*Service.java" /> <jbossxmlservicetemplate servicefile="jboss" /> </jmxdoclet> </target>
The problem here is that everything i need in my jboss-service.xml file i have to write by hand in merge file jboss-service.ent. If i remove 'mergeDir' from jmxdoclet task I will receive
empty jboss-service.xml. That is strange for me, becouse i created all tags in my MyService.java file. The same info which is necessary to generate file MyService.xml. That should be enought to create jboss-service.xml file also.
3.
Could you explain me persist policy strategies? (OnUpdate, NoMoreOftenThan, Never, OnTimer)
I don't get what persistence for mbean means.
Please, if you know anything which could help me to solve my problems just reply :)
I will be very gratefull for any help.
Thank you in advance.
vitor_b