org.jboss.jmx.examples.configuration
Class SampleService

java.lang.Object
  extended by org.jboss.mx.util.JBossNotificationBroadcasterSupport
      extended by org.jboss.system.ServiceMBeanSupport
          extended by org.jboss.jmx.examples.configuration.SampleService
All Implemented Interfaces:
MBeanRegistration, NotificationBroadcaster, NotificationEmitter, SampleServiceMBean, org.jboss.kernel.spi.dependency.KernelControllerContextAware, Service, ServiceMBean

public class SampleService
extends ServiceMBeanSupport
implements SampleServiceMBean

Author:
Tom Elrod

Field Summary
 
Fields inherited from class org.jboss.system.ServiceMBeanSupport
server, SERVICE_CONTROLLER_SIG, serviceName
 
Fields inherited from interface org.jboss.system.ServiceMBean
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED
 
Constructor Summary
SampleService()
           
 
Method Summary
 void createSampleConfigMBean()
           
 String getName()
          Use the short class name as the default for the service name.
protected  void startService()
          Sub-classes should override this method to provide custum 'start' logic.
protected  void stopService()
           
 
Methods inherited from class org.jboss.system.ServiceMBeanSupport
create, createService, destroy, destroyService, getDeploymentInfo, getLog, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, pojoChange, pojoCreate, pojoDestroy, pojoStart, pojoStop, postDeregister, postRegister, preDeregister, preRegister, setKernelControllerContext, start, stop, unsetKernelControllerContext
 
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport
addNotificationListener, getNotificationInfo, handleNotification, nextNotificationSequenceNumber, removeNotificationListener, removeNotificationListener, sendNotification
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.system.ServiceMBean
getState, getStateString, jbossInternalLifecycle
 
Methods inherited from interface org.jboss.system.Service
create, destroy, start, stop
 

Constructor Detail

SampleService

public SampleService()
Method Detail

getName

public String getName()
Use the short class name as the default for the service name.

Specified by:
getName in interface ServiceMBean
Overrides:
getName in class ServiceMBeanSupport

startService

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.

Overrides:
startService in class ServiceMBeanSupport
Throws:
Exception

stopService

protected void stopService()
                    throws Exception
Overrides:
stopService in class ServiceMBeanSupport
Throws:
Exception

createSampleConfigMBean

public void createSampleConfigMBean()
                             throws MalformedObjectNameException,
                                    InstanceAlreadyExistsException,
                                    MBeanRegistrationException,
                                    NotCompliantMBeanException
Specified by:
createSampleConfigMBean in interface SampleServiceMBean
Throws:
MalformedObjectNameException
InstanceAlreadyExistsException
MBeanRegistrationException
NotCompliantMBeanException


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.