Home » JBoss-5.1.0 » org » jboss » system » [javadoc | source]
org.jboss.system
public class: ServiceMBeanSupport [javadoc | source]
java.lang.Object
   org.jboss.mx.util.JBossNotificationBroadcasterSupport
      org.jboss.system.ServiceMBeanSupport

All Implemented Interfaces:
    KernelControllerContextAware, ServiceMBean, MBeanRegistration, NotificationEmitter

An abstract base class JBoss services can subclass to implement a service that conforms to the ServiceMBean interface. Subclasses must override #getName method and should override #startService , and #stopService as approriate.
Field Summary
public static final  String[] SERVICE_CONTROLLER_SIG    The signature for service controller operations 
protected  Logger log    The instance logger for the service. Not using a class logger because we want to dynamically obtain the logger name from concreate sub-classes. 
protected  MBeanServer server    The MBeanServer which we have been register with. 
protected  ObjectName serviceName    The object name which we are registsred under. 
Constructor:
 public ServiceMBeanSupport() 
 public ServiceMBeanSupport(Class type) 
    Construct a ServiceMBeanSupport.

    Sets up logging.

    Parameters:
    type - The class type to determine category name from.
 public ServiceMBeanSupport(String category) 
    Construct a ServiceMBeanSupport.

    Sets up logging.

    Parameters:
    category - The logger category name.
 public ServiceMBeanSupport(Logger log) 
    Construct a ServiceMBeanSupport.
    Parameters:
    log - The logger to use.
Method from org.jboss.system.ServiceMBeanSupport Summary:
create,   createService,   destroy,   destroyService,   getDeploymentInfo,   getLog,   getName,   getNextNotificationSequenceNumber,   getObjectName,   getServer,   getServiceName,   getState,   getStateString,   jbossInternalCreate,   jbossInternalDescription,   jbossInternalDestroy,   jbossInternalLifecycle,   jbossInternalStart,   jbossInternalStop,   pojoChange,   pojoCreate,   pojoDestroy,   pojoStart,   pojoStop,   postDeregister,   postRegister,   preDeregister,   preRegister,   setKernelControllerContext,   start,   startService,   stop,   stopService,   unsetKernelControllerContext
Methods from org.jboss.mx.util.JBossNotificationBroadcasterSupport:
addNotificationListener,   getNotificationInfo,   handleNotification,   nextNotificationSequenceNumber,   removeNotificationListener,   removeNotificationListener,   sendNotification
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.system.ServiceMBeanSupport Detail:
 public  void create() throws Exception 
 protected  void createService() throws Exception 
    Sub-classes should override this method to provide custum 'create' logic.

    This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

 public  void destroy() 
 protected  void destroyService() throws Exception 
    Sub-classes should override this method to provide custum 'destroy' logic.

    This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

 public DeploymentInfo getDeploymentInfo() throws JMException 
    Provide access to the service DeploymentInfo. This is only available after the service has passed its create step.
 public Logger getLog() 
 public String getName() 
    Use the short class name as the default for the service name.
 protected long getNextNotificationSequenceNumber() 
    The getNextNotificationSequenceNumber method returns the next sequence number for use in notifications.
 protected ObjectName getObjectName(MBeanServer server,
    ObjectName name) throws MalformedObjectNameException 
    Sub-classes should override this method if they only need to set their object name during MBean pre-registration.
 public MBeanServer getServer() 
 public ObjectName getServiceName() 
 public int getState() 
 public String getStateString() 
 protected  void jbossInternalCreate() throws Exception 
 protected String jbossInternalDescription() 
 protected  void jbossInternalDestroy() 
 public  void jbossInternalLifecycle(String method) throws Exception 
 protected  void jbossInternalStart() throws Exception 
 protected  void jbossInternalStop() 
 protected  void pojoChange(ControllerState state) 
 public  void pojoCreate() throws Exception 
 public  void pojoDestroy() throws Exception 
 public  void pojoStart() throws Exception 
 public  void pojoStop() throws Exception 
 public  void postDeregister() 
 public  void postRegister(Boolean registrationDone) 
 public  void preDeregister() throws Exception 
 public ObjectName preRegister(MBeanServer server,
    ObjectName name) throws Exception 
    Callback method of MBeanRegistration before the MBean is registered at the JMX Agent.

    Attention: Always call this method when you overwrite it in a subclass because it saves the Object Name of the MBean.

 public  void setKernelControllerContext(KernelControllerContext controllerContext) throws Exception 
 public  void start() throws Exception 
 protected  void startService() throws Exception 
    Sub-classes should override this method to provide custum 'start' logic.

    This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

 public  void stop() 
 protected  void stopService() throws Exception 
    Sub-classes should override this method to provide custum 'stop' logic.

    This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.

 public  void unsetKernelControllerContext(KernelControllerContext controllerContext) throws Exception