diff --git a/node/src/main/kotlin/com/r3corda/node/internal/AbstractNode.kt b/node/src/main/kotlin/com/r3corda/node/internal/AbstractNode.kt index 1eb2ab54c1..7580da60e5 100644 --- a/node/src/main/kotlin/com/r3corda/node/internal/AbstractNode.kt +++ b/node/src/main/kotlin/com/r3corda/node/internal/AbstractNode.kt @@ -114,7 +114,7 @@ abstract class AbstractNode(val configuration: NodeConfiguration, val networkMap return smm.add(loggerName, logic).resultFuture } - override fun

> registerProtocolInitiator(markerClass: KClass, protocolFactory: (Party) -> ProtocolLogic<*>) { + override fun registerProtocolInitiator(markerClass: KClass<*>, protocolFactory: (Party) -> ProtocolLogic<*>) { require(markerClass !in protocolFactories) { "${markerClass.java.name} has already been used to register a protocol" } log.debug { "Registering ${markerClass.java.name}" } protocolFactories[markerClass.java] = protocolFactory diff --git a/node/src/main/kotlin/com/r3corda/node/services/api/ServiceHubInternal.kt b/node/src/main/kotlin/com/r3corda/node/services/api/ServiceHubInternal.kt index 86d9a1c738..f087fcca94 100644 --- a/node/src/main/kotlin/com/r3corda/node/services/api/ServiceHubInternal.kt +++ b/node/src/main/kotlin/com/r3corda/node/services/api/ServiceHubInternal.kt @@ -76,12 +76,12 @@ abstract class ServiceHubInternal : ServiceHub { * marker class has been registered then the corresponding factory will be used to create the protocol which will * communicate with the other side. If there is no mapping then the session attempt is rejected. * @param markerClass The marker [KClass] present in a session initiation attempt, which is a 1:1 mapping to a [Class] - * using the

::class
construct. Any marker class can be used, with the default being the class of the initiating - * protocol. This enables the registration to be of the form: registerProtocolInitiator(InitiatorProtocol::class, ::InitiatedProtocol) + * using the
::class
construct. Conventionally this is a [ProtocolLogic] subclass, however any class can + * be used, with the default being the class of the initiating protocol. This enables the registration to be of the + * form: registerProtocolInitiator(InitiatorProtocol::class, ::InitiatedProtocol) * @param protocolFactory The protocol factory generating the initiated protocol. - * @param R the return type of the protocol logic */ - abstract fun

> registerProtocolInitiator(markerClass: KClass, protocolFactory: (Party) -> ProtocolLogic<*>) + abstract fun registerProtocolInitiator(markerClass: KClass<*>, protocolFactory: (Party) -> ProtocolLogic<*>) /** * Return the protocol factory that has been registered with [markerClass], or null if no factory is found. diff --git a/node/src/test/kotlin/com/r3corda/node/services/MockServiceHubInternal.kt b/node/src/test/kotlin/com/r3corda/node/services/MockServiceHubInternal.kt index bb38499543..657d23a79b 100644 --- a/node/src/test/kotlin/com/r3corda/node/services/MockServiceHubInternal.kt +++ b/node/src/test/kotlin/com/r3corda/node/services/MockServiceHubInternal.kt @@ -75,7 +75,7 @@ open class MockServiceHubInternal( return smm.add(loggerName, logic).resultFuture } - override fun

> registerProtocolInitiator(markerClass: KClass, protocolFactory: (Party) -> ProtocolLogic<*>) { + override fun registerProtocolInitiator(markerClass: KClass<*>, protocolFactory: (Party) -> ProtocolLogic<*>) { protocolFactories[markerClass.java] = protocolFactory }