Currently Being Moderated

ServiceMBeanSupport

VERSION 4

Created on: May 21, 2004 7:45 PM by Adrian Brock - Last Modified:  Oct 14, 2006 3:43 PM by Elias Ross

The Standard MBean Helper (ServiceMBeanSupport)

 

The
org.jboss.system.ServiceMBean
management interface

 

This interface exposes the lifecycle methods, and a couple of other informational

attributes for state and name. It also holds some constants for the possible state values

and notifications emitted. You just need to extend this with your management interface.

 

The
org.jboss.system.ServiceMBeanSupport
abstract class

 

Fortunately JBoss does a lot of work to implement the

ServiceMBean

interface. By extending the

ServiceMBeanSupport

abstract class, you only need to implement the following lifecycle methods. JBoss handles the state machine to make sure they are invoked in the correct order handling the state attribute and notifications.


protected void createService() throws Exception;
protected void startService() throws Exception;
protected void stopService() throws Exception;
protected void destroyService() throws Exception;

 

Additionally, you get the following helpers:


protected org.jboss.logging.Logger log; // A logger 
protected javax.management.MBeanServer server; // The MBeanServer
protected javax.management.ObjectName serviceName; // The service's ObjectName

 

Notes

 

It is not intended that you override other methods with the exception of the following:


public String getName(); // A text string describing the service

 

See BindMBeanToJNDI for a simple subclass of

ServiceMBeanSupport

.

 

Average User Rating
(0 ratings)




There are no comments on this article

More Like This

  • Retrieving data ...