JBoss.org Community Documentation
Dependencies of an EJB on a service or services, including other EJBs, may be specified through the
<depends>
tag of the jboss.xml deployment descriptor. The <depends>
tag is analagous to the @org.jboss.ejb3.annotation.Depends
annotation. The dependencies control
the deployment of EJBs such that an EJB will not deploy until all of it's dependencies have successfully deployed.
Take a look at META-INF/jboss-service.xml
. This service deployment descriptor starts
a service based on org.jboss.tutorial.dependency.bean.DependedOn
.
<server> <mbean code="org.jboss.tutorial.dependency.bean.DependedOn" name="jboss.test:service=DependedOn"/> </server>
Take a look at META-INF/jboss.xml
. This deployment descriptor indicates that the
HasXmlMBeanDependencyBean
is dependent on the jboss.test:service=DependedOn
started by jboss-service.xml
. The HasXmlMBeanDependencyBean
will not
deploy until the jboss.test:service=DependedOn
service has successfully started.
To build and run the example, make sure you have installed JBoss 5.x. See the Section 1.1, “JBoss Application Server 5.x” for details.
From the command prompt, move to the "dependency" folder under the Section 1.3, “Set the EJB3_TUTORIAL_HOME”
Make sure your JBossAS-5.x is running
$ ant $ ant run run: [java] Lookup and bean access succeeded
$ mvn clean install -PRunSingleTutorial