InstanceStore 类

定义

表示一个实例存储区。Represents an instance store.

public ref class InstanceStore abstract
public abstract class InstanceStore
type InstanceStore = class
Public MustInherit Class InstanceStore
继承
InstanceStore
派生

注解

永久性提供程序可通过 InstanceStore 类的具体实现来提供对实例存储区的访问。A persistence provider provides access to an instance store through a concrete implementation of the InstanceStore class.

即使此命令已完成执行,永久性提供程序也可以在已传递给 TryCommand 的句柄上调用 InstanceHandle.Free。Persistence providers may call InstanceHandle.Free on handles passed to TryCommand, even after the command has finished executing. 但是,永久性提供程序不得保留对 InstanceHandle or InstanceOwner 对象的强引用,因为这会阻止 InstanceStore 进行垃圾回收。But persistence providers must not hold strong references to InstanceHandle or InstanceOwner objects, as this can prevent InstanceStore from being garbage collected.

警告

不能更改持久化工作流的工作流定义。Workflow definitions for persisted workflows cannot be changed. 如果工作流定义在持久保存后发生更改, 则在重新加载工作流时, 工作流运行时将崩溃。If a workflow definition is changed after it is persisted, the workflow runtime will crash when the workflow is reloaded.

构造函数

InstanceStore()

初始化 InstanceStore 类的实例。Initializes an instance of the InstanceStore class.

属性

DefaultInstanceOwner

获取或设置默认实例的所有者。Gets or sets the default instance owner.

方法

BeginExecute(InstanceHandle, InstancePersistenceCommand, TimeSpan, AsyncCallback, Object)

异步执行永久性命令,如 LoadWorkflowCommandSaveWorkflowCommandAsynchronously executes persistence commands such as LoadWorkflowCommand and SaveWorkflowCommand.

BeginTryCommand(InstancePersistenceContext, InstancePersistenceCommand, TimeSpan, AsyncCallback, Object)

永久性提供程序可实现此方法,这可确定是否可执行特定的永久性命令。A persistence provider implements this method, which determines whether a particular persistence command can be executed. 如果可以执行此命令,请异步执行此命令。If the command can be executed, executes the command asynchronously.

BeginWaitForEvents(InstanceHandle, TimeSpan, AsyncCallback, Object)

开始一个异步操作,以侦听特定实例句柄的实例存储区引发的任何事件。Begins an asynchronous operation to listen for any events raised by the instance store for a specific instance handle.

CreateInstanceHandle()

创建实例句柄。Creates an instance handle.

CreateInstanceHandle(Guid)

创建实例句柄。Creates an instance handle. 如果设置了 DefaultInstanceOwner,此值将作为新句柄的实例所有者自动被绑定。If the DefaultInstanceOwner is set, the value is automatically bound as the new handle's instance owner. 作为参数传递的实例标识符会作为新句柄的实例自动进行绑定。The instance identifier passed as a parameter is automatically bound as the new handle's instance.

CreateInstanceHandle(InstanceOwner)

创建实例句柄。Creates an instance handle. 如果作为参数传递的实例所有者不为 null,则此值会作为新的句柄实例所有者自动进行绑定。If the instance owner passed as a parameter is not null, the value is automatically bound as the new handle's instance owner. (否则,即使设置了 DefaultInstanceOwner,也不会绑定任何实例所有者。)(Otherwise, no instance owner is bound, even if DefaultInstanceOwner is set.)

CreateInstanceHandle(InstanceOwner, Guid)

创建实例句柄。Creates an instance handle. 如果作为参数传递的实例所有者不为 null,则此值会作为新的句柄实例所有者自动进行绑定。If the instance owner passed as a parameter is not null, the value is automatically bound as the new handle's instance owner. (否则,即使设置了 DefaultInstanceOwner,也不会绑定任何实例所有者。)作为参数传递的实例标识符会作为新句柄的实例自动进行绑定。(Otherwise, no instance owner is bound, even if DefaultInstanceOwner is set.) The instance identifier passed as a parameter is automatically bound as the new handle's instance.

EndExecute(IAsyncResult)

结束异步操作。Ends the asynchronous operation.

EndTryCommand(IAsyncResult)

结束异步操作。Ends an asynchronous operation.

EndWaitForEvents(IAsyncResult)

结束由 BeginWaitForEvents(InstanceHandle, TimeSpan, AsyncCallback, Object) 方法启动的异步操作。Ends the asynchronous operation initiated by the BeginWaitForEvents(InstanceHandle, TimeSpan, AsyncCallback, Object) method.

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
Execute(InstanceHandle, InstancePersistenceCommand, TimeSpan)

异步执行永久性命令。Executes a persistence command synchronously. 永久性命令的示例:LoadWorkflowCommandSaveWorkflowCommandExamples of persistence commands are: LoadWorkflowCommand and SaveWorkflowCommand.

GetEvents(InstanceOwner)

获取已绑定到 InstanceOwner 对象的所有已终止事件。Gets all the signaled events bound to an InstanceOwner object.

GetHashCode()

用作默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetInstanceOwners()

获取已绑定到有效实例句柄或没有进行垃圾回收的每个 InstanceOwner 对象。Gets each InstanceOwner object that is bound to a valid instance handle or has not been garbage collected.

GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
OnFreeInstanceHandle(InstanceHandle, Object)

在释放实例句柄时调用。Invoked when an instance handle is freed.

OnNewInstanceHandle(InstanceHandle)

在创建新实例句柄时调用。Invoked when a new instance handle is created.

ResetEvent(InstancePersistenceEvent, InstanceOwner)

重置已终止事件,并从由实例所有者维护的已终止事件的列表中移除该事件。Resets the signaled event and removes the event from the signaled events list maintained by the instance owner.

SignalEvent(InstancePersistenceEvent, InstanceOwner)

实例存储区可调用此方法来使事件终止。An instance store invokes this method to signal an event. 为此永久性事件订阅的工作流主机可接收这些信号,并可采取适当的措施。A workflow host that subscribes for this persistence event receives it and takes an appropriate action.

ToString()

返回一个表示当前对象的 string。Returns a string that represents the current object.

(继承自 Object)
TryCommand(InstancePersistenceContext, InstancePersistenceCommand, TimeSpan)

永久性提供程序可实现此方法,这可确定是否可执行特定的永久性命令和是否可异步执行此命令。A persistence provider implements this method, which determines whether a particular persistence command can be executed and if the command can be executed executes it asynchronously.

WaitForEvents(InstanceHandle, TimeSpan)

工作流主机通常会调用此方法来等待事件终止。A workflow host typically invokes this method to wait for an event to be signaled.

适用于