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
ADomainManager
that uses Apache ZooKeeper for leadership elections.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
connect()
Implementations must connect via this method.protected void
disconnect()
Implementations must disconnect via this method.protected void
failedToConnect(java.lang.Throwable exception)
Implementations can optionally override this if they need special handling for a failure to connect.java.lang.String
toString()
-
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(java.lang.Throwable exception)
Description copied from class:ConnectionBasedDomainManager
Implementations can optionally override this if they need special handling for a failure to connect.- Overrides:
failedToConnect
in classConnectionBasedDomainManager
- Parameters:
exception
- the exception that caused the failure the connect
-
connect
protected void connect()
Description copied from class:ConnectionBasedDomainManager
Implementations 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:
connect
in classConnectionBasedDomainManager
-
disconnect
protected void disconnect()
Description copied from class:ConnectionBasedDomainManager
Implementations 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:
disconnect
in classConnectionBasedDomainManager
-
toString
public java.lang.String toString()
- Overrides:
toString
in classConnectionBasedDomainManager
-
-