rd-framework / com.jetbrains.rd.framework.impl / ProtocolContexts

ProtocolContexts

class ProtocolContexts : RdReactiveBase

This class handles RdContext on protocol level. It tracks existing contexts and allows access to their value sets (when present)

Constructors

<init>

ProtocolContexts(serializationCtx: SerializationCtx)

This class handles RdContext on protocol level. It tracks existing contexts and allows access to their value sets (when present)

Properties

async

var async: Boolean

If set to true, local changes to this object can be performed on any thread. Otherwise, local changes can be performed only on the UI thread.

registeredContexts

val registeredContexts: Collection<RdContext<*>>

serializationCtx

val serializationCtx: SerializationCtx

wireScheduler

val wireScheduler: <ERROR CLASS>

Scheduler on which wire invokes callback onWireReceived. Default is the same as protocol's one.

Inherited Properties

defaultScheduler

val defaultScheduler: <ERROR CLASS>

isLocalChange

var isLocalChange: Boolean

master

var master: Boolean

serializers

val serializers: ISerializers

wire

val wire: IWire

Functions

deepClone

fun deepClone(): IRdBindable

getValueSet

fun <T : Any> getValueSet(context: RdContext<T>): <ERROR CLASS><T>

Get a value set for a given context

init

fun init(lifetime: <ERROR CLASS>): Unit

onWireReceived

fun onWireReceived(buffer: AbstractBuffer): Unit

Callback that wire triggers when it receives messaged

readMessageContextAndInvoke

fun readMessageContextAndInvoke(buffer: AbstractBuffer, action: () -> Unit): Unit

Reads a context from a given buffer and invokes the provided action in it

registerContext

fun <T : Any> registerContext(context: RdContext<T>): Unit

Registers a context to be used with this protocol. Must be invoked on protocol's scheduler

writeCurrentMessageContext

fun writeCurrentMessageContext(buffer: AbstractBuffer): Unit

Writes the current context values to the given buffer

Inherited Functions

assertBound

fun assertBound(): Unit

assertThreading

fun assertThreading(): Unit

Companion Object Functions

writeEmptyContexts

fun writeEmptyContexts(buffer: AbstractBuffer): Unit

Writes an empty context

Extension Functions

bind

fun <T : IRdBindable?> T.bind(lf: <ERROR CLASS>, parent: IRdDynamic, name: String): Unit?

deepClonePolymorphic

fun <T> T.deepClonePolymorphic(): T

identify

fun <T : IRdBindable?> T.identify(identities: IIdentities, ids: RdId): Unit?

static

fun <T : RdBindableBase> T.static(id: Int): T

withId

fun <T : RdBindableBase> T.withId(id: RdId): T

withIdFromName

fun <T : RdBindableBase> T.withIdFromName(name: String): T