Redagować

Udostępnij przez


SystemTarget Class

Definition

Base class for various system services, such as grain directory, reminder service, etc. Made public for GrainService to inherit from it. Can be turned to internal after a refactoring that would remove the inheritance relation.

public abstract class SystemTarget : Orleans.ISystemTarget
public abstract class SystemTarget : IDisposable, IEquatable<Orleans.Runtime.IGrainContext>, ISpanFormattable, Orleans.ISystemTarget, Orleans.Runtime.IGrainExtension, Orleans.Runtime.IGrainExtensionBinder, Orleans.Serialization.Invocation.ITargetHolder
public abstract class SystemTarget : IEquatable<Orleans.Runtime.IGrainContext>, Orleans.ISystemTarget
public abstract class SystemTarget : IDisposable, IEquatable<Orleans.Runtime.IGrainContext>, ISpanFormattable, Orleans.ISystemTarget, Orleans.Runtime.IGrainExtensionBinder, Orleans.Serialization.Invocation.ITargetHolder
type SystemTarget = class
    interface ISystemTarget
    interface IAddressable
type SystemTarget = class
    interface ISystemTarget
    interface IAddressable
    interface IGrainContext
    interface ITargetHolder
    interface IEquatable<IGrainContext>
    interface IGrainExtensionBinder
    interface ISpanFormattable
    interface IFormattable
    interface IDisposable
    interface IGrainExtension
type SystemTarget = class
    interface ISystemTarget
    interface IAddressable
    interface IEquatable<IGrainContext>
type SystemTarget = class
    interface ISystemTarget
    interface IAddressable
    interface IGrainContext
    interface ITargetHolder
    interface IEquatable<IGrainContext>
    interface IGrainExtensionBinder
    interface ISpanFormattable
    interface IFormattable
    interface IDisposable
Public MustInherit Class SystemTarget
Implements ISystemTarget
Public MustInherit Class SystemTarget
Implements IDisposable, IEquatable(Of IGrainContext), IGrainExtension, IGrainExtensionBinder, ISpanFormattable, ISystemTarget, ITargetHolder
Public MustInherit Class SystemTarget
Implements IEquatable(Of IGrainContext), ISystemTarget
Public MustInherit Class SystemTarget
Implements IDisposable, IEquatable(Of IGrainContext), IGrainExtensionBinder, ISpanFormattable, ISystemTarget, ITargetHolder
Inheritance
SystemTarget
Derived
Implements

Constructors

Name Description
SystemTarget()
Obsolete.

Obsolete parameterless constructor for SystemTarget.

Breaking change: This constructor is obsolete and will throw a NotSupportedException if called. It is present only to satisfy certain reflection-based scenarios and should not be used in application code.

If you are using reflection or serialization frameworks that require a parameterless constructor, update your code to use the constructor with parameters: Orleans.Runtime.SystemTarget.#ctor(Orleans.Runtime.SystemTargetGrainId,Orleans.Runtime.SystemTargetShared).

Properties

Name Description
ActivationServices

Gets the IServiceProvider that provides access to the grain activation's service container.

Deactivated

Gets the Task which completes when the grain has deactivated.

GrainId

Gets the grain identity.

GrainReference

Gets a reference to this grain.

IsLowPriority
Scheduler

Gets the scheduler.

Silo

Silo address of the system target.

Methods

Name Description
Activate(Dictionary<String,Object>, CancellationToken)

Start activating this instance.

Activate(Dictionary<String,Object>, Nullable<CancellationToken>)

Start activating this instance.

Deactivate(DeactivationReason, CancellationToken)

Start deactivating this instance.

Deactivate(DeactivationReason, Nullable<CancellationToken>)

Start deactivating this instance.

Dispose()
GetComponent<TComponent>()

Gets the component with the specified type.

GetExtension<TExtensionInterface>()

Returns the grain extension registered for the provided TExtensionInterface.

GetOrSetExtension<TExtension,TExtensionInterface>(Func<TExtension>)

Binds an extension to an addressable object, if not already done.

GetTarget()

Gets the target instance.

GetTarget<TTarget>()

Gets the target.

Migrate(Dictionary<String,Object>, CancellationToken)
Migrate(Dictionary<String,Object>, Nullable<CancellationToken>)
ReceiveMessage(Object)

Submits an incoming message to this instance.

RegisterGrainTimer(Func<CancellationToken,Task>, TimeSpan, TimeSpan)

Registers a timer to send regular callbacks to this system target.

RegisterGrainTimer<TState>(Func<TState,CancellationToken,Task>, TState, TimeSpan, TimeSpan)

Registers a timer to send regular callbacks to this grain. This timer will keep the current grain from being deactivated.

RegisterTimer(Func<Object,Task>, Object, TimeSpan, TimeSpan, String)

Register a timer to send regular callbacks to this grain. This timer will keep the current grain from being deactivated.

RegisterTimer(Func<Object,Task>, Object, TimeSpan, TimeSpan)

Registers a timer to send regular callbacks to this system target.

Rehydrate(IRehydrationContext)
SetComponent<TComponent>(TComponent)

Sets the provided value as the component for type TComponent.

ToString()

Override of object.ToString()

Explicit Interface Implementations

Name Description
IEquatable<IGrainContext>.Equals(IGrainContext)

Indicates whether the current object is equal to another object of the same type.

IFormattable.ToString(String, IFormatProvider)
IGrainContext.ActivationId

Gets the activation id.

IGrainContext.Address

Gets the activation address.

IGrainContext.GrainInstance

Gets the grain instance, or null if the grain instance has not been set yet.

IGrainContext.ObservableLifecycle

Gets the observable Grain lifecycle, which can be used to add lifecycle hooks.

ISpanFormattable.TryFormat(Span<Char>, Int32, ReadOnlySpan<Char>, IFormatProvider)
ITargetHolder.GetComponent(Type)

Gets the component with the specified type.

ITargetHolder.GetComponent<TComponent>()

Gets the component with the specified type.

Extension Methods

Name Description
AsReference(IAddressable, Type)

Returns a typed reference to the provided grain.

AsReference<TGrainInterface>(IAddressable)

Returns a typed reference to the provided grain.

BindGrainReference(IAddressable, IGrainFactory)

Binds the grain reference to the provided IGrainFactory.

Cast(IAddressable, Type)

Returns a typed reference to the provided grain.

Cast<TGrainInterface>(IAddressable)

Returns a typed reference to the provided grain.

DeactivateAsync(IGrainContext, DeactivationReason, CancellationToken)
Obsolete.

Deactivates the provided grain.

DeactivateAsync(IGrainContext, DeactivationReason, Nullable<CancellationToken>)

Deactivates the provided grain.

GetComponent<TComponent>(ITargetHolder)

Gets the component with the specified type.

GetGrainExtension<TComponent>(IGrainContext)

Used by generated code for IGrainExtension interfaces.

GetGrainId(IAddressable)

Returns the grain id corresponding to the provided grain.

GetPrimaryKey(IAddressable, String)

Returns the Guid representation of a grain primary key.

GetPrimaryKey(IAddressable)

Returns the Guid representation of a grain primary key.

GetPrimaryKeyLong(IAddressable, String)

Returns the long representation of a grain primary key.

GetPrimaryKeyLong(IAddressable)

Returns the long representation of a grain primary key.

GetPrimaryKeyString(IAddressable)

Returns the string primary key of the grain.

IsPrimaryKeyBasedOnLong(IAddressable)

Returns whether part of the primary key is of type long.

ScheduleTask(SystemTarget, Action)

Schedules the provided action on the SystemTarget's Orleans.Runtime.ISchedulingContext.

ScheduleTask(SystemTarget, Func<Task>)

Schedules the provided action on the SystemTarget's Orleans.Runtime.ISchedulingContext.

ScheduleTask<T>(SystemTarget, Func<Task<T>>)

Schedules the provided action on the SystemTarget.

Applies to