mirror of
https://github.com/corda/corda.git
synced 2025-01-12 16:02:41 +00:00
Minor refactoring and api doc update
This commit is contained in:
parent
4dedb6fc2e
commit
6eb91ffe8b
@ -45,7 +45,7 @@ class ConfigurationException(message: String) : Exception(message)
|
|||||||
* A Node manages a standalone server that takes part in the P2P network. It creates the services found in [ServiceHub],
|
* A Node manages a standalone server that takes part in the P2P network. It creates the services found in [ServiceHub],
|
||||||
* loads important data off disk and starts listening for connections.
|
* loads important data off disk and starts listening for connections.
|
||||||
*
|
*
|
||||||
* @param configuration This is typically loaded from a .properties file.
|
* @param configuration This is typically loaded from a TypeSafe HOCON configuration file.
|
||||||
* @param networkMapAddress An external network map service to use. Should only ever be null when creating the first
|
* @param networkMapAddress An external network map service to use. Should only ever be null when creating the first
|
||||||
* network map service, while bootstrapping a network.
|
* network map service, while bootstrapping a network.
|
||||||
* @param advertisedServices The services this node advertises. This must be a subset of the services it runs,
|
* @param advertisedServices The services this node advertises. This must be a subset of the services it runs,
|
||||||
@ -111,10 +111,12 @@ class Node(override val configuration: FullNodeConfiguration, networkMapAddress:
|
|||||||
private var shutdownThread: Thread? = null
|
private var shutdownThread: Thread? = null
|
||||||
|
|
||||||
override fun makeMessagingService(): MessagingServiceInternal {
|
override fun makeMessagingService(): MessagingServiceInternal {
|
||||||
val serverAddr = configuration.messagingServerAddress ?: {
|
val serverAddr = with(configuration) {
|
||||||
messageBroker = ArtemisMessagingServer(configuration, configuration.artemisAddress, services.networkMapCache)
|
messagingServerAddress ?: {
|
||||||
configuration.artemisAddress
|
messageBroker = ArtemisMessagingServer(this, artemisAddress, services.networkMapCache)
|
||||||
|
artemisAddress
|
||||||
}()
|
}()
|
||||||
|
}
|
||||||
val myIdentityOrNullIfNetworkMapService = if (networkMapService != null) services.storageService.myLegalIdentityKey.public else null
|
val myIdentityOrNullIfNetworkMapService = if (networkMapService != null) services.storageService.myLegalIdentityKey.public else null
|
||||||
return NodeMessagingClient(configuration, serverAddr, myIdentityOrNullIfNetworkMapService, serverThread,
|
return NodeMessagingClient(configuration, serverAddr, myIdentityOrNullIfNetworkMapService, serverThread,
|
||||||
persistenceTx = { body: () -> Unit -> databaseTransaction(database) { body() } })
|
persistenceTx = { body: () -> Unit -> databaseTransaction(database) { body() } })
|
||||||
|
Loading…
Reference in New Issue
Block a user