net.corda.core.node

## Interface PluginServiceHub

- All Superinterfaces:
    ServiceHub, ServicesForResolution
  All Known Implementing Classes:
    ServiceHubInternal

      public PluginServiceHub
      extends ServiceHub

  A service hub to be used by the `class CordaPluginRegistry`

  See Also:
    `class CordaPluginRegistry`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface net.corda.core.node.ServiceHub

      `ServiceHub.DefaultImpls`

  - ### Method Summary

    All Methods Instance Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `kotlin.jvm.functions.Function1<net.corda.core.crypto.Party,net.corda.core.flows.FlowLogic>` | `getFlowFactory(java.lang.Class<?> markerClass)` Return the flow factory that has been registered with markerClass, or null if no factory is found.
    `void` | `registerFlowInitiator(kotlin.reflect.KClass<?> markerClass, kotlin.jvm.functions.Function1<? super net.corda.core.crypto.Party,? extends net.corda.core.flows.FlowLogic<?>> flowFactory)` Register the flow factory we wish to use when a initiating party attempts to communicate with us. The registration is done against a marker KClass which is sent in the session handshake by the other party. If this marker class has been registered then the corresponding factory will be used to create the flow which will communicate with the other side. If there is no mapping then the session attempt is rejected.

    - ### Methods inherited from interface net.corda.core.node.ServiceHub

      `getClock, getKeyManagementService, getLegalIdentityKey, getMyInfo, getNetworkMapCache, getNetworkService, getNotaryIdentityKey, getSchedulerService, getStorageService, getVaultService, invokeFlowAsync, loadState, recordTransactions, recordTransactions, toStateAndRef`

    - ### Methods inherited from interface net.corda.core.node.ServicesForResolution

      `getIdentityService, getStorageService, loadState`

- - ### Method Detail

    - #### registerFlowInitiator

          void registerFlowInitiator(kotlin.reflect.KClass<?> markerClass,
                                     kotlin.jvm.functions.Function1<? super net.corda.core.crypto.Party,? extends net.corda.core.flows.FlowLogic<?>> flowFactory)

      Register the flow factory we wish to use when a initiating party attempts to communicate with us. The registration is done against a marker KClass which is sent in the session handshake by the other party. If this marker class has been registered then the corresponding factory will be used to create the flow which will communicate with the other side. If there is no mapping then the session attempt is rejected.

      Parameters:
        `markerClass` - The marker KClass present in a session initiation attempt, which is a 1:1 mapping to a Class using the ::class construct. Conventionally this is a `class FlowLogic` subclass, however any class can be used, with the default being the class of the initiating flow. This enables the registration to be of the form: registerFlowInitiator(InitiatorFlow::class, ::InitiatedFlow)
        `flowFactory` - The flow factory generating the initiated flow.

    - #### getFlowFactory

          kotlin.jvm.functions.Function1<net.corda.core.crypto.Party,net.corda.core.flows.FlowLogic> getFlowFactory(java.lang.Class<?> markerClass)

      Return the flow factory that has been registered with markerClass, or null if no factory is found.