ENT-2559: Gracefully handle Artemis connectivity loss during Bridge leader election (#1436)

* ENT-2559: KDocs update and change visibility identifiers.

* ENT-2559: Handle upstream dependencies going up and down.

* ENT-2500: Address code review comments by @mnesbit
This commit is contained in:
Viktor Kolomeyko
2018-10-03 18:56:15 +01:00
committed by GitHub
parent a037c59e3a
commit 50a1819e47
3 changed files with 101 additions and 62 deletions

View File

@ -5,20 +5,20 @@ package net.corda.nodeapi.internal.zookeeper
* Listener interface for leader election results, to avoid public reference to shadowed curator classes.
*/
interface CordaLeaderListener {
/**
* This is called when the LeaderLatch's state goes from hasLeadership = false to hasLeadership = true.
*
* Note that it is possible that by the time this method call happens, hasLeadership has fallen back to false. If
* this occurs, you can expect {@link #notLeader()} to also be called.
*/
fun notLeader()
/**
* This is called when the LeaderLatch's state goes from hasLeadership = true to hasLeadership = false.
*
* Note that it is possible that by the time this method call happens, hasLeadership has become true. If
* this occurs, you can expect {@link #isLeader()} to also be called.
*/
fun notLeader()
/**
* This is called when the LeaderLatch's state goes from hasLeadership = false to hasLeadership = true.
*
* Note that it is possible that by the time this method call happens, hasLeadership has fallen back to false. If
* this occurs, you can expect {@link #notLeader()} to also be called.
*/
fun isLeader()
}
@ -58,12 +58,12 @@ interface ZkLeader {
fun removeLeadershipListener(listener: CordaLeaderListener)
/**
* @return [true] if client is the current leader, [false] otherwise
* @return `true` if client is the current leader, `false` otherwise
*/
fun isLeader(): Boolean
/**
* @return [true] if client is started, [false] otherwise
* @return `true` if client is started, `false` otherwise
*/
fun isStarted(): Boolean
}