|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationBroadcasterSupport
org.jboss.system.ServiceMBeanSupport
org.jboss.system.ListenerServiceMBeanSupport
org.jboss.system.BarrierController
public class 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
The controlled barrier MBean class |
static interface |
BarrierController.BarrierMBean
The controlled barrier MBean interface |
Nested classes/interfaces inherited from class org.jboss.system.ListenerServiceMBeanSupport |
---|
ListenerServiceMBeanSupport.SubscriptionInfo |
Field Summary | |
---|---|
protected BarrierController.Barrier |
barrier
The controlled Barrier |
Fields inherited from class org.jboss.system.ServiceMBeanSupport |
---|
log, server, SERVICE_CONTROLLER_SIG, serviceName |
Fields inherited from interface org.jboss.system.BarrierControllerMBean |
---|
OBJECT_NAME |
Fields inherited from interface org.jboss.system.ListenerServiceMBean |
---|
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 |
---|
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 Boolean |
enableOnStartup()
Override this method to apply complex logic whether to start the Barrier service upon startup or not. |
Boolean |
getBarrierEnabledOnStartup()
The initial state of the barrier. |
javax.management.ObjectName |
getBarrierObjectName()
The controlled barrier ObjectName. |
String |
getBarrierStateString()
The controlled barrier StateString. |
Boolean |
getDynamicSubscriptions()
The ability to dynamically subscribe for notifications. |
String |
getStartBarrierHandback()
The notification subscription handback string that starts the barrier. |
String |
getStopBarrierHandback()
The notification subscription handback string that stops the barrier. |
void |
handleNotification2(javax.management.Notification n,
Object handback)
Base on the handback object the decision for starting/stopping the barrier |
void |
setBarrierEnabledOnStartup(Boolean enableOnStartup)
The initial state of the barrier. |
void |
setBarrierObjectName(javax.management.ObjectName barrierName)
The controlled barrier ObjectName. |
void |
setDynamicSubscriptions(Boolean dynamicSubscriptions)
The ability to dynamically subscribe for notifications. |
void |
setStartBarrierHandback(String startHandback)
The notification subscription handback string that starts the barrier. |
void |
setStopBarrierHandback(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 |
---|
handleNotification, setSubscriptionList, subscribe, subscribe, subscribe, unsubscribe |
Methods inherited from class org.jboss.system.ServiceMBeanSupport |
---|
create, destroy, getDeploymentInfo, 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 |
---|
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.ListenerServiceMBean |
---|
setSubscriptionList |
Methods inherited from interface org.jboss.system.ServiceMBean |
---|
getName, getState, getStateString, jbossInternalLifecycle |
Methods inherited from interface org.jboss.system.Service |
---|
create, destroy, start, stop |
Field Detail |
---|
protected BarrierController.Barrier barrier
Constructor Detail |
---|
public BarrierController()
Method Detail |
---|
public String getBarrierStateString()
getBarrierStateString
in interface BarrierControllerMBean
public void setBarrierObjectName(javax.management.ObjectName barrierName)
setBarrierObjectName
in interface BarrierControllerMBean
public javax.management.ObjectName getBarrierObjectName()
getBarrierObjectName
in interface BarrierControllerMBean
public void setBarrierEnabledOnStartup(Boolean enableOnStartup)
setBarrierEnabledOnStartup
in interface BarrierControllerMBean
public Boolean getBarrierEnabledOnStartup()
getBarrierEnabledOnStartup
in interface BarrierControllerMBean
public void setStartBarrierHandback(String startHandback)
setStartBarrierHandback
in interface BarrierControllerMBean
public String getStartBarrierHandback()
getStartBarrierHandback
in interface BarrierControllerMBean
public void setStopBarrierHandback(String stopHandback)
setStopBarrierHandback
in interface BarrierControllerMBean
public String getStopBarrierHandback()
getStopBarrierHandback
in interface BarrierControllerMBean
public void setDynamicSubscriptions(Boolean dynamicSubscriptions)
setDynamicSubscriptions
in interface BarrierControllerMBean
public Boolean getDynamicSubscriptions()
getDynamicSubscriptions
in interface BarrierControllerMBean
protected Boolean enableOnStartup()
protected void createService() throws Exception
ServiceMBeanSupport
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
Exception
protected void destroyService()
ServiceMBeanSupport
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
public void handleNotification2(javax.management.Notification n, Object handback)
handleNotification2
in class ListenerServiceMBeanSupport
public void startBarrier()
startBarrier
in interface BarrierControllerMBean
public void stopBarrier()
stopBarrier
in interface BarrierControllerMBean
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |