public final class ZookeeperDomainManager extends ConnectionBasedDomainManager
DomainManager
that uses Apache ZooKeeper for leadership elections.Modifier and Type | Method and Description |
---|---|
protected void |
connect()
Implementations must connect via this method.
|
protected void |
disconnect()
Implementations must disconnect via this method.
|
protected void |
failedToConnect(Throwable exception)
Implementations can optionally override this if they need special handling for a failure to connect.
|
String |
toString() |
isConnected, onFirstRegister, onLastDeregister
becomeActive, becomeStandby, deregister, getCurrentRole, getDomain, getRoleChangeHandlers, isAnythingRegistered, isRegistered, register
protected void failedToConnect(Throwable exception)
ConnectionBasedDomainManager
failedToConnect
in class ConnectionBasedDomainManager
exception
- the exception that caused the failure the connectprotected void connect()
ConnectionBasedDomainManager
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.
connect
in class ConnectionBasedDomainManager
protected void disconnect()
ConnectionBasedDomainManager
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.
disconnect
in class ConnectionBasedDomainManager
public String toString()
toString
in class ConnectionBasedDomainManager
Copyright © 2021. All rights reserved.