|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport (src)
org.jboss.system.ServiceMBeanSupport (src)
org.jboss.system.ListenerServiceMBeanSupport (src)
org.jboss.system.BarrierController
BarrierController service. A service that controls the lifecycle of a secondary mbean (the BarrierMbean) that can be used as a dependency for other services. Starting and stopping the barrier mbean (and as a result all services depending on it) is performed by listening for any kind of JMX notification. In particular we use the handback object of a notification subscription to qualify the start and stop signals. Manual control of the barrier is also supported through startBarrier()/stopBarrier() methods. You may subclass BarrierController and override enableOnStartup() to apply complex logic in deciding whether to initially start the barrier (e.g. query some other mbean).
Nested Class Summary | |
static class |
BarrierController.Barrier (src)
The controlled barrier MBean class |
static interface |
BarrierController.BarrierMBean (src)
The controlled barrier MBean interface |
Nested classes inherited from class org.jboss.system.ListenerServiceMBeanSupport (src) |
ListenerServiceMBeanSupport.SubscriptionInfo (src) |
Field Summary | |
protected BarrierController.Barrier (src) |
barrier
The controlled Barrier |
Fields inherited from class org.jboss.system.ServiceMBeanSupport (src) |
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.ListenerServiceMBean (src) |
SL_FILTER_ELEMENT, SL_FILTER_FACTORY_ATTRIBUTE, SL_MBEAN_ELEMENT, SL_MBEAN_HANDBACK_ATTRIBUTE, SL_MBEAN_NAME_ATTRIBUTE, SL_NOTIFICATION_ELEMENT, SL_NOTIFICATION_TYPE_ATTRIBUTE, SL_ROOT_ELEMENT |
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 | |
BarrierController()
Default CTOR |
Method Summary | |
protected void |
createService()
Sub-classes should override this method to provide custum 'create' logic. |
protected void |
destroyService()
Sub-classes should override this method to provide custum 'destroy' logic. |
protected java.lang.Boolean |
enableOnStartup()
Override this method to apply complex logic whether to start the Barrier service upon startup or not. |
java.lang.Boolean |
getBarrierEnabledOnStartup()
The initial state of the barrier. |
ObjectName (src) |
getBarrierObjectName()
The controlled barrier ObjectName. |
java.lang.String |
getBarrierStateString()
The controlled barrier StateString. |
java.lang.Boolean |
getDynamicSubscriptions()
The ability to dynamically subscribe for notifications. |
java.lang.String |
getStartBarrierHandback()
The notification subscription handback string that starts the barrier. |
java.lang.String |
getStopBarrierHandback()
The notification subscription handback string that stops the barrier. |
void |
handleNotification2(Notification (src) n,
java.lang.Object handback)
Base on the handback object the decision for starting/stopping the barrier |
void |
setBarrierEnabledOnStartup(java.lang.Boolean enableOnStartup)
The initial state of the barrier. |
void |
setBarrierObjectName(ObjectName (src) barrierName)
The controlled barrier ObjectName. |
void |
setDynamicSubscriptions(java.lang.Boolean dynamicSubscriptions)
The ability to dynamically subscribe for notifications. |
void |
setStartBarrierHandback(java.lang.String startHandback)
The notification subscription handback string that starts the barrier. |
void |
setStopBarrierHandback(java.lang.String stopHandback)
The notification subscription handback string that stops the barrier. |
void |
startBarrier()
Manually start the controlled barrier |
void |
stopBarrier()
Manually stop the controlled barrier |
Methods inherited from class org.jboss.system.ListenerServiceMBeanSupport (src) |
handleNotification, setSubscriptionList, subscribe, subscribe, subscribe, unsubscribe |
Methods inherited from class org.jboss.system.ServiceMBeanSupport (src) |
create, destroy, getLog, getName, getNextNotificationSequenceNumber, getObjectName, getServer, getServiceName, getState, getStateString, jbossInternalCreate, jbossInternalDescription, jbossInternalDestroy, jbossInternalLifecycle, jbossInternalStart, jbossInternalStop, postDeregister, postRegister, preDeregister, preRegister, start, startService, stop, stopService |
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 |
Methods inherited from interface org.jboss.system.ServiceMBean (src) |
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service (src) |
create, destroy, start, stop |
Field Detail |
protected BarrierController.Barrier (src) barrier
Constructor Detail |
public BarrierController()
Method Detail |
public java.lang.String getBarrierStateString()
public void setBarrierObjectName(ObjectName (src) barrierName)
public ObjectName (src) getBarrierObjectName()
public void setBarrierEnabledOnStartup(java.lang.Boolean enableOnStartup)
public java.lang.Boolean getBarrierEnabledOnStartup()
public void setStartBarrierHandback(java.lang.String startHandback)
public java.lang.String getStartBarrierHandback()
public void setStopBarrierHandback(java.lang.String stopHandback)
public java.lang.String getStopBarrierHandback()
public void setDynamicSubscriptions(java.lang.Boolean dynamicSubscriptions)
public java.lang.Boolean getDynamicSubscriptions()
protected java.lang.Boolean enableOnStartup()
protected void createService() throws java.lang.Exception
ServiceMBeanSupport (src)
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
createService
in class ServiceMBeanSupport (src)
java.lang.Exception
protected void destroyService()
ServiceMBeanSupport (src)
This method is empty, and is provided for convenience when concrete service classes do not need to perform anything specific for this state change.
destroyService
in class ServiceMBeanSupport (src)
public void handleNotification2(Notification (src) n, java.lang.Object handback)
handleNotification2
in class ListenerServiceMBeanSupport (src)
public void startBarrier()
public void stopBarrier()
|
||||||||||
PREV CLASS NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |