|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.mx.util.JBossNotificationBroadcasterSupport org.jboss.system.ServiceMBeanSupport
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.
ServiceMBean
Field Summary | |
protected org.jboss.logging.Logger |
log
The instance logger for the service. |
protected javax.management.MBeanServer |
server
The MBeanServer which we have been register with. |
static String[] |
SERVICE_CONTROLLER_SIG
The signature for service controller operations |
protected javax.management.ObjectName |
serviceName
The object name which we are registsred under. |
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 | |
ServiceMBeanSupport()
Construct a |
|
ServiceMBeanSupport(Class type)
Construct a |
|
ServiceMBeanSupport(org.jboss.logging.Logger log)
Construct a |
|
ServiceMBeanSupport(String category)
Construct a |
Method Summary | |
void |
create()
create the service, do expensive operations etc |
protected void |
createService()
Sub-classes should override this method to provide custum 'create' logic. |
void |
destroy()
destroy the service, tear down |
protected void |
destroyService()
Sub-classes should override this method to provide custum 'destroy' logic. |
org.jboss.logging.Logger |
getLog()
|
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 javax.management.ObjectName |
getObjectName(javax.management.MBeanServer server,
javax.management.ObjectName name)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration. |
javax.management.MBeanServer |
getServer()
|
javax.management.ObjectName |
getServiceName()
|
int |
getState()
|
String |
getStateString()
|
protected void |
jbossInternalCreate()
|
protected String |
jbossInternalDescription()
|
protected void |
jbossInternalDestroy()
|
void |
jbossInternalLifecycle(String method)
Detyped lifecycle invocation |
protected void |
jbossInternalStart()
|
protected void |
jbossInternalStop()
|
void |
postDeregister()
|
void |
postRegister(Boolean registrationDone)
|
void |
preDeregister()
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
Callback method of MBeanRegistration
before the MBean is registered at the JMX Agent. |
void |
start()
start the service, create is already called |
protected void |
startService()
Sub-classes should override this method to provide custum 'start' logic. |
void |
stop()
stop the service |
protected void |
stopService()
Sub-classes should override this method to provide custum 'stop' logic. |
Methods inherited from class org.jboss.mx.util.JBossNotificationBroadcasterSupport |
addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String[] SERVICE_CONTROLLER_SIG
protected org.jboss.logging.Logger log
protected javax.management.MBeanServer server
protected javax.management.ObjectName serviceName
Constructor Detail |
public ServiceMBeanSupport()
Sets up logging.
public ServiceMBeanSupport(Class type)
Sets up logging.
type
- The class type to determine category name from.public ServiceMBeanSupport(String category)
Sets up logging.
category
- The logger category name.public ServiceMBeanSupport(org.jboss.logging.Logger log)
log
- The logger to use.Method Detail |
public String getName()
getName
in interface ServiceMBean
public javax.management.ObjectName getServiceName()
public javax.management.MBeanServer getServer()
public int getState()
getState
in interface ServiceMBean
public String getStateString()
getStateString
in interface ServiceMBean
public org.jboss.logging.Logger getLog()
public void create() throws Exception
Service
Exception
public void start() throws Exception
Service
Exception
public void stop()
public void destroy()
Service
protected String jbossInternalDescription()
public void jbossInternalLifecycle(String method) throws Exception
ServiceMBean
jbossInternalLifecycle
in interface ServiceMBean
Exception
protected void jbossInternalCreate() throws Exception
Exception
protected void jbossInternalStart() throws Exception
Exception
protected void jbossInternalStop()
protected void jbossInternalDestroy()
public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name) throws Exception
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.
preRegister
in interface javax.management.MBeanRegistration
server
- Reference to the JMX Agent this MBean is registered onname
- Name specified by the creator of the MBean. Note that you can
overwrite it when the given ObjectName is null otherwise the
change is discarded (maybe a bug in JMX-RI).
Exception
public void postRegister(Boolean registrationDone)
postRegister
in interface javax.management.MBeanRegistration
public void preDeregister() throws Exception
preDeregister
in interface javax.management.MBeanRegistration
Exception
public void postDeregister()
postDeregister
in interface javax.management.MBeanRegistration
protected long getNextNotificationSequenceNumber()
getNextNotificationSequenceNumber
method returns
the next sequence number for use in notifications.
long
valueprotected javax.management.ObjectName getObjectName(javax.management.MBeanServer server, javax.management.ObjectName name) throws javax.management.MalformedObjectNameException
javax.management.MalformedObjectNameException
protected void createService() throws Exception
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
Exception
protected void startService() throws Exception
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
Exception
protected void stopService() throws Exception
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
Exception
protected void destroyService() throws Exception
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
Exception
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |