You can't change the order because this is part of the JMX spec. Note that you can hand over constructor arguments in the like:
<mbean ... >
Note that the list of arguments must match an available constructor in your MBean and that the type is important and that you don't now what it means in the service.xml file.
Have fun - Andy
You might want to implement the jboss service lifecycle, create/start/stop/destroy called in order by the container. setAttributes will be called before create. You don't have to implement all te methods as I recall... usually I use the non-dynamic ServiceMBeanSupport base class and a standard mbean.
Thanks for the suggestions and answers.
One more stupid question: could you point me to the interface/class name for the JBoss service interface?
org.jboss.system.Service, in the system module. I'm not sure you need to implement the interface explicitly if you have a dynamic mbean. The Container class is dynamic and uses the lifecycle stuff, you could compare. (server module, org.jboss.ejb.Container).
If you decide on a standard mbean, you want your interface to extend ServiceMBean and might want your class to extend ServiceMBeanSupport.
Thanks for the info!