com.r3corda.node.services.api / AbstractNodeService / addProtocolHandler

addProtocolHandler

protected inline fun <reified H : HandshakeMessage, R : Any> addProtocolHandler(topic: String, loggerName: String, crossinline protocolFactory: (H) -> ProtocolLogic<R>, crossinline onResultFuture: (<ERROR CLASS><R>, H) -> Unit): Unit

Register a handler to kick-off a protocol when a HandshakeMessage is received by the node. This performs the necessary steps to enable communication between the two protocols, including calling ProtocolLogic.registerSession.

Parameters

topic - the topic on which the handshake is sent from the other party

loggerName - the logger name to use when starting the protocol

protocolFactory - a function to create the protocol with the given handshake message

onResultFuture - provides access to the ListenableFuture when the protocol starts


protected inline fun <reified H : HandshakeMessage, R : Any> addProtocolHandler(topic: String, loggerName: String, crossinline protocolFactory: (H) -> ProtocolLogic<R>): Unit