abstract class RdContext<T : Any>
Describes a context and provides access to value associated with this context. The associated value is thread-local and synchronized between send/advise pairs on IWire. The associated value will be the same in handler method in IWire.advise as it was in IWire.send. Instances of this class with the same key will share the associated value. Best practice is to declare contexts in toplevel entities in protocol model using Toplevel.context. Manual declaration is also possible.
key - textual name of this context. This is used to match this with protocol counterparts
heavy - Whether or not this context is heavy. A heavy context maintains a value set and interns values. A light context sends values as-is and does not maintain a value set.
serializer - Serializer to be used with this context.
See Also
com.jetbrains.rd.generator.nova.Toplevel.context
companion object Companion : ISerializer<RdContext<*>> |
RdContext(key: String, heavy: Boolean, serializer: IMarshaller<T>)
Describes a context and provides access to value associated with this context. The associated value is thread-local and synchronized between send/advise pairs on IWire. The associated value will be the same in handler method in IWire.advise as it was in IWire.send. Instances of this class with the same key will share the associated value. Best practice is to declare contexts in toplevel entities in protocol model using Toplevel.context. Manual declaration is also possible. |
val heavy: Boolean
Whether or not this context is heavy. A heavy context maintains a value set and interns values. A light context sends values as-is and does not maintain a value set. |
|
val key: String
textual name of this context. This is used to match this with protocol counterparts |
|
val serializer: IMarshaller<T>
Serializer to be used with this context. |
|
var value: T?
The current (thread-local) value for this context |
|
open var valueForPerContextEntity: T?
Value which is used as a key inside per-context entities like RdPerContextMap |
open fun equals(other: Any?): Boolean |
|
open fun hashCode(): Int |
fun marshallerFor(context: RdContext<*>): IMarshaller<RdContext<*>> |
|
fun read(ctx: SerializationCtx, buffer: AbstractBuffer): RdContext<*> |
|
fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: RdContext<*>): Unit |
fun <T> T.deepClonePolymorphic(): T |