Class ZookeeperDomainManager
- java.lang.Object
-
- org.opennms.features.distributed.coordination.common.AbstractDomainManager
-
- org.opennms.features.distributed.coordination.common.ConnectionBasedDomainManager
-
- org.opennms.features.distributed.coordination.zookeeper.ZookeeperDomainManager
-
- All Implemented Interfaces:
DomainManager
public final class ZookeeperDomainManager extends ConnectionBasedDomainManager
ADomainManagerthat uses Apache ZooKeeper for leadership elections.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidconnect()Implementations must connect via this method.protected voiddisconnect()Implementations must disconnect via this method.protected voidfailedToConnect(Throwable exception)Implementations can optionally override this if they need special handling for a failure to connect.StringtoString()-
Methods inherited from class org.opennms.features.distributed.coordination.common.ConnectionBasedDomainManager
isConnected, onFirstRegister, onLastDeregister
-
Methods inherited from class org.opennms.features.distributed.coordination.common.AbstractDomainManager
becomeActive, becomeStandby, deregister, getCurrentRole, getDomain, getRoleChangeHandlers, isAnythingRegistered, isRegistered, register
-
-
-
-
Method Detail
-
failedToConnect
protected void failedToConnect(Throwable exception)
Description copied from class:ConnectionBasedDomainManagerImplementations can optionally override this if they need special handling for a failure to connect.- Overrides:
failedToConnectin classConnectionBasedDomainManager- Parameters:
exception- the exception that caused the failure the connect
-
connect
protected void connect()
Description copied from class:ConnectionBasedDomainManagerImplementations must connect via this method.This is executed in a separate thread so timeliness is not a factor. It is possible that multiple calls to connect() block waiting for the first one to finish so implementations of this method must be written to guard against this being a problem.
- Specified by:
connectin classConnectionBasedDomainManager
-
disconnect
protected void disconnect()
Description copied from class:ConnectionBasedDomainManagerImplementations must disconnect via this method.This is executed in a separate thread so timeliness is not a factor. It is possible that multiple calls to disconnect() block waiting for the first one to finish so implementations of this method must be written to guard against this being a problem.
- Specified by:
disconnectin classConnectionBasedDomainManager
-
toString
public String toString()
- Overrides:
toStringin classConnectionBasedDomainManager
-
-