com.r3corda.node.services.statemachine / ProtocolStateMachineImpl

# ProtocolStateMachineImpl

`class ProtocolStateMachineImpl<R> : ProtocolStateMachine<R>`

### Constructors

<init> | `ProtocolStateMachineImpl(id: StateMachineRunId, logic: ProtocolLogic<R>, scheduler: FiberScheduler)`

### Properties

id | `val id: StateMachineRunId` Unique ID for this machine run, valid across restarts
logger | `val logger: <ERROR CLASS>`
logic | `val logic: ProtocolLogic<R>`
resultFuture | `val resultFuture: <ERROR CLASS><R>` This future will complete when the call method returns.
serviceHub | `lateinit var serviceHub: ServiceHubInternal`

### Functions

receive | `fun <T : Any> receive(otherParty: Party, receiveType: Class<T>, sessionProtocol: ProtocolLogic<*>): UntrustworthyData<T>`
run | `fun run(): R`
send | `fun send(otherParty: Party, payload: Any, sessionProtocol: ProtocolLogic<*>): Unit`
sendAndReceive | `fun <T : Any> sendAndReceive(otherParty: Party, payload: Any, receiveType: Class<T>, sessionProtocol: ProtocolLogic<*>): UntrustworthyData<T>`

### Companion Object Functions

currentStateMachine | `fun currentStateMachine(): ProtocolStateMachineImpl<*>?` Return the current ProtocolStateMachineImpl or null if executing outside of one.