mirror of
https://github.com/corda/corda.git
synced 2025-06-22 09:08:49 +00:00
Rename net to network (#773)
* So net no longer interferes with IntelliJ auto-import of net.* packages * Use mockNet for MockNetwork to avoid clashing with Node network
This commit is contained in:
@ -233,7 +233,7 @@ class MockNetwork(private val networkSendManuallyPumped: Boolean = false,
|
||||
@Suppress("unused") val place: PhysicalLocation get() = findMyLocation()!!
|
||||
|
||||
fun pumpReceive(block: Boolean = false): InMemoryMessagingNetwork.MessageTransfer? {
|
||||
return (net as InMemoryMessagingNetwork.InMemoryMessaging).pumpReceive(block)
|
||||
return (network as InMemoryMessagingNetwork.InMemoryMessaging).pumpReceive(block)
|
||||
}
|
||||
|
||||
fun disableDBCloseOnStop() {
|
||||
@ -382,7 +382,7 @@ class MockNetwork(private val networkSendManuallyPumped: Boolean = false,
|
||||
}
|
||||
|
||||
@Suppress("unused") // This is used from the network visualiser tool.
|
||||
fun addressToNode(address: SingleMessageRecipient): MockNode = nodes.single { it.net.myAddress == address }
|
||||
fun addressToNode(address: SingleMessageRecipient): MockNode = nodes.single { it.network.myAddress == address }
|
||||
|
||||
fun startNodes() {
|
||||
require(nodes.isNotEmpty())
|
||||
|
@ -45,7 +45,7 @@ class SimpleNode(val config: NodeConfiguration, val address: HostAndPort = freeL
|
||||
val executor = ServiceAffinityExecutor(config.myLegalName.commonName, 1)
|
||||
val broker = ArtemisMessagingServer(config, address.port, rpcAddress.port, InMemoryNetworkMapCache(), userService)
|
||||
val networkMapRegistrationFuture: SettableFuture<Unit> = SettableFuture.create<Unit>()
|
||||
val net = database.transaction {
|
||||
val network = database.transaction {
|
||||
NodeMessagingClient(
|
||||
config,
|
||||
MOCK_VERSION_INFO,
|
||||
@ -59,18 +59,18 @@ class SimpleNode(val config: NodeConfiguration, val address: HostAndPort = freeL
|
||||
|
||||
fun start() {
|
||||
broker.start()
|
||||
net.start(
|
||||
network.start(
|
||||
object : RPCOps {
|
||||
override val protocolVersion = 0
|
||||
},
|
||||
userService)
|
||||
thread(name = config.myLegalName.commonName) {
|
||||
net.run(broker.serverControl)
|
||||
network.run(broker.serverControl)
|
||||
}
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
net.stop()
|
||||
network.stop()
|
||||
broker.stop()
|
||||
databaseWithCloseable.first.close()
|
||||
executor.shutdownNow()
|
||||
|
Reference in New Issue
Block a user