1 Reply Latest reply on Dec 1, 2009 4:38 AM by jaikiran pai

    How to setting up an MBean depend on some SessionBeans

    Larry Xu Newbie

      I am working on a JBoss J2EE application.

      I met a problem when I used MBean which depend on some EJBs.

      How can an MBean depend on a SessionBean?

      In JBoss4 I find a way to specify MBean depends on some SessionBeans by adding below words in jboss-app.xml

      <module-order>strict</module-order>


      Now we are working on JBoss5.1, it seems doesn't work on JBoss5.1
      I only find the similar function by the annotation 'depends' or xml setting like below.
      @Depends({"jboss.j2ee:ear=slam-slaengineear-1.0-SCALABILITY.ear,jar=slam-persistence-slaengine-1.0-SCALABILITY.jar,name=SLAPollingConfigDAOBean,service=EJB3",
      "jboss.j2ee:ear=slam-slaengineear-1.0-SCALABILITY.ear,jar=tt-rawevent-ctr-1.0-SCALABILITY.jar,name=TTRawEventControllerBean,service=EJB3",
      "jboss.j2ee:ear=slam-slaengineear-1.0-SCALABILITY.ear,jar=tt-rawevent-ctr-1.0-SCALABILITY.jar,name=IncidentRawEventControllerBean,service=EJB3"})


      But I don't want to keep this way because it is not a elegant way and I have to specify all references EJBs in the annotation.

      Do you have any idea on it?
      May be we can set the MBean depends on EJBContainer service, then MBean will be deployed after the EJBContainer ready.
      Thanks advance

        • 1. Re: How to setting up an MBean depend on some SessionBeans
          jaikiran pai Master

           

          "larryxu77" wrote:


          In JBoss4 I find a way to specify MBean depends on some SessionBeans by adding below words in jboss-app.xml
          <jboss>
          <module-order>strict</module-order>
          </jboss>




          That's fixed in the upcoming JBoss AS 6.0 M1.

          "larryxu77" wrote:

          Now we are working on JBoss5.1, it seems doesn't work on JBoss5.1
          I only find the similar function by the annotation 'depends' or xml setting like below.
          @Depends(...)

          But I don't want to keep this way because it is not a elegant way and I have to specify all references EJBs in the annotation.

          Your MBean depends on *all* EJBs? Ideally the @Depends on the MBean should only point to the EJB on which the Mbean depends.