File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes Configuring Service MBean for Application Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Configuring Service MBean for Application" Watch "Configuring Service MBean for Application" New topic

Configuring Service MBean for Application

Anuja Piplapure

Joined: Feb 06, 2005
Posts: 7

We use Jboss4.0.1 in our application. We have created a service mbean for our application which extends ServiceMBean and in turn ServiceMBeanSupport.
According to the requirement of our application and also according to the general behaviour of service beans, it is necessary that the startService method of the service mbean, be invoked after all the EJBs ( especially entity beans )have been deployed.
Similarly it is necessary that the stopService method of the service mbean be invoked before the undeployment of the application EJBs and entity beans in particular begins. This way it ensures that the required process is done for the application at the start and stop of the service.

We have defined the service mbean in the jboss-service.xml in the server/all/conf folder. The service mbean is mentioned as follows in the end of the jboss-service.xml ::

<mbean code="com.application.messagebeans.initmbean.InitSession" name="jboss:service=InitSession"/>

But we have seen that though the startService is invoked after the deployment of all the entitybeans of the application. But the stop service method is invoked only after all the entitybeans are undeployed.

Is there some other configuration that is required to be done in any other xml file ? Or is any xml file required to be added to the bean? what exactly needs to be done ?

Earlier this worked perfectly in jboss 2.4.4. So have no idea why this is not working in the desired way with jboss4.0.1.

Thanks in advance for help.

I agree. Here's the link:
subject: Configuring Service MBean for Application
It's not a secret anymore!