That's what service dependencies are all about.
<server> <mbean code="XXX" name="mydomain:name=mbean1"> <depends>mydomain:name=mbean2</depends> </mbean> <mbean code="YYY" name="mydomain:name=mbean2"/> </server>
My question was not about service dependencies. I want a particular service to stay in CREATED state for a long time after the deployment is finished. At some point in time later (which is determined by an external event) it will be started. Essentially I'm talking about ability to pre-create a service abd start it on demand, not during the deployment. Thanks
JBoss currenlty has no notion of deploying a service in stopped mode.
A possible hack is to not override the start() method, e.g. write a start2() then decide in your code when this other method should be called, e.g. upon reception of a particular JMX notification.
The only problem is that jboss will not have a correct view of the status of your that will be reported as STARTED nevertheless, even if start() is missing.