How MBean Depends on EJB in JBoss 7

I use MBean in Jboss 7. Mbean needs to call some EJBs at startup, but I can’t control the order in which EJBs and MBeans start. In Jboss 4, I can do this using befine MBean in jboss-service.xml with a dependency tag. But in Jboss 7 this way no longer works.

<mbean code="com.mycompany.vms.adapter.connector.SourceConnector" name="mycompany:service=SourceConnector,source=SILTERRA" xmbean-dd="META-INF/SILTERRA-SourceConnector-xmbean.xml">
    <depends>jboss.j2ee:jndiName=mycompany/vms/ImportService,service=EJB</depends>
    <depends>jboss.j2ee:service=EJB,jndiName=mycompany/vms/EJBCommandService</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/ReceiverQueue</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/DMuxerQueue</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/ChannelProcessorQueue</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/TransactionProcessorQueue</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/SynchronizerQueue</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/CommandQueue</depends>
    <depends>jboss.mq.destination:service=Topic,name=vms/SystemAlertsTopic</depends>
    <depends>jboss.mq.destination:service=Queue,name=vms/LotIssueQueue</depends>
</mbean>

Please help me with this. Anyway, can you do it on JBoss7?

+4
source share
2 answers

You can convert your MBean into a @Singletoncalled @Startupone by injecting your EJB dependencies into it.

More details here and here .

0
source

Source: https://habr.com/ru/post/1570838/


All Articles