|
||||||||||
PREV CLASS (src) NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
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
(src) Field Summary | |
protected Logger (src) |
log
The instance logger for the service. |
protected MBeanServer (src) |
server
The MBeanServer which we have been register with. |
static java.lang.String[] |
SERVICE_CONTROLLER_SIG
The signature for service controller operations |
protected ObjectName (src) |
serviceName
The object name which we are registsred under. |
Fields inherited from interface org.jboss.system.ServiceMBean (src) |
CREATE_EVENT, CREATED, DESTROY_EVENT, DESTROYED, FAILED, REGISTERED, START_EVENT, STARTED, STARTING, states, STOP_EVENT, STOPPED, STOPPING, UNREGISTERED |
Constructor Summary | |
ServiceMBeanSupport()
Construct a |
|
ServiceMBeanSupport(java.lang.Class type)
Construct a |
|
ServiceMBeanSupport(Logger (src) log)
Construct a |
|
ServiceMBeanSupport(java.lang.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. |
Logger (src) |
getLog()
|
java.lang.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 (src) |
getObjectName(MBeanServer (src) server,
ObjectName (src) name)
Sub-classes should override this method if they only need to set their object name during MBean pre-registration. |
MBeanServer (src) |
getServer()
|
ObjectName (src) |
getServiceName()
|
int |
getState()
|
java.lang.String |
getStateString()
|
protected void |
jbossInternalCreate()
|
protected java.lang.String |
jbossInternalDescription()
|
void |
jbossInternalDestroy()
|
void |
jbossInternalLifecycle(java.lang.String method)
Detyped lifecycle invocation |
void |
jbossInternalStart()
|
void |
jbossInternalStop()
|
void |
postDeregister()
This method is called by the MBeanServer after deregistration takes place. |
void |
postRegister(java.lang.Boolean registrationDone)
This method is called by the MBeanServer after registration takes place or when registration fails. |
void |
preDeregister()
This method is called by the MBeanServer before deregistration takes place. |
ObjectName (src) |
preRegister(MBeanServer (src) server,
ObjectName (src) name)
Callback method of MBeanRegistration (src)
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 (src) |
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 java.lang.String[] SERVICE_CONTROLLER_SIG
protected Logger (src) log
protected MBeanServer (src) server
protected ObjectName (src) serviceName
Constructor Detail |
public ServiceMBeanSupport()
Sets up logging.
public ServiceMBeanSupport(java.lang.Class type)
Sets up logging.
type
- The class type to determine category name from.public ServiceMBeanSupport(java.lang.String category)
Sets up logging.
category
- The logger category name.public ServiceMBeanSupport(Logger (src) log)
log
- The logger to use.Method Detail |
public java.lang.String getName()
getName
in interface ServiceMBean (src)
public ObjectName (src) getServiceName()
public MBeanServer (src) getServer()
public int getState()
getState
in interface ServiceMBean (src)
public java.lang.String getStateString()
getStateString
in interface ServiceMBean (src)
public Logger (src) getLog()
public void create() throws java.lang.Exception
Service (src)
create
in interface Service (src)
java.lang.Exception
public void start() throws java.lang.Exception
Service (src)
start
in interface Service (src)
java.lang.Exception
public void stop()
Service (src)
stop
in interface Service (src)
public void destroy()
Service (src)
destroy
in interface Service (src)
protected java.lang.String jbossInternalDescription()
public void jbossInternalLifecycle(java.lang.String method) throws java.lang.Exception
ServiceMBean (src)
jbossInternalLifecycle
in interface ServiceMBean (src)
java.lang.Exception
protected void jbossInternalCreate() throws java.lang.Exception
java.lang.Exception
public void jbossInternalStart() throws java.lang.Exception
java.lang.Exception
public void jbossInternalStop()
public void jbossInternalDestroy()
public ObjectName (src) preRegister(MBeanServer (src) server, ObjectName (src) name) throws java.lang.Exception
MBeanRegistration
(src)
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 MBeanRegistration (src)
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).
java.lang.Exception
- for any error, the MBean is not registered.public void postRegister(java.lang.Boolean registrationDone)
MBeanRegistration (src)
postRegister
in interface MBeanRegistration (src)
registrationDone
- the MBeanServer passes true when the
MBean was registered, false otherwise.public void preDeregister() throws java.lang.Exception
MBeanRegistration (src)
The MBean can throw an exception, this will stop the deregistration. The exception is forwarded to the invoker wrapped in an MBeanRegistrationException.
preDeregister
in interface MBeanRegistration (src)
java.lang.Exception
public void postDeregister()
MBeanRegistration (src)
postDeregister
in interface MBeanRegistration (src)
protected long getNextNotificationSequenceNumber()
getNextNotificationSequenceNumber
method returns
the next sequence number for use in notifications.
long
valueprotected ObjectName (src) getObjectName(MBeanServer (src) server, ObjectName (src) name) throws MalformedObjectNameException (src)
MalformedObjectNameException (src)
protected void createService() throws java.lang.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.
java.lang.Exception
protected void startService() throws java.lang.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.
java.lang.Exception
protected void stopService() throws java.lang.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.
java.lang.Exception
protected void destroyService() throws java.lang.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.
java.lang.Exception
|
||||||||||
PREV CLASS (src) NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |