node: prefix private field with '_', use get() =

This commit is contained in:
Andras Slemmer 2016-06-13 14:01:16 +01:00
parent 50cd3c938a
commit 16465ba475
2 changed files with 6 additions and 4 deletions

View File

@ -113,8 +113,9 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
private set
/** Completes once the node has successfully registered with the network map service */
private val networkMapRegistrationSettableFuture: SettableFuture<Unit> = SettableFuture.create()
val networkMapRegistrationFuture: ListenableFuture<Unit> = networkMapRegistrationSettableFuture
private val _networkMapRegistrationSettableFuture: SettableFuture<Unit> = SettableFuture.create()
val networkMapRegistrationFuture: ListenableFuture<Unit>
get() = _networkMapRegistrationSettableFuture
/** Set to true once [start] has been successfully called. */
@Volatile var started = false
@ -148,7 +149,7 @@ abstract class AbstractNode(val dir: Path, val configuration: NodeConfiguration,
CashBalanceAsMetricsObserver(services)
startMessagingService()
networkMapRegistrationSettableFuture.setFuture(registerWithNetworkMap())
_networkMapRegistrationSettableFuture.setFuture(registerWithNetworkMap())
isPreviousCheckpointsPresent = checkpointStorage.checkpoints.any()
smm.start()
started = true

View File

@ -81,7 +81,8 @@ class InMemoryMessagingNetwork() : SingletonSerializeAsToken() {
private val _allMessages = PublishSubject.create<MessageTransfer>()
/** A stream of (sender, message, recipients) triples */
val allMessages: Observable<MessageTransfer> = _allMessages
val allMessages: Observable<MessageTransfer>
get() = _allMessages
interface LatencyCalculator {
fun between(sender: SingleMessageRecipient, receiver: SingleMessageRecipient): Duration