ChannelFactoryBase 类

定义

为所有自定义通道工厂提供一个通用基实现。Provides a common base implementation for all custom channel factories.

public ref class ChannelFactoryBase abstract : System::ServiceModel::Channels::ChannelManagerBase, System::ServiceModel::Channels::IChannelFactory
public abstract class ChannelFactoryBase : System.ServiceModel.Channels.ChannelManagerBase, System.ServiceModel.Channels.IChannelFactory
type ChannelFactoryBase = class
    inherit ChannelManagerBase
    interface IChannelFactory
    interface ICommunicationObject
Public MustInherit Class ChannelFactoryBase
Inherits ChannelManagerBase
Implements IChannelFactory
继承
派生
实现

注解

使用此基类可以创建自定义通道工厂。Use this base class to create a custom channel factory.

ChannelFactoryBase 类派生自 ChannelManagerBase 类,并实现 IChannelFactory 接口以便创建通道。The ChannelFactoryBase class derives from the ChannelManagerBase class and implements the IChannelFactory interface for creating channels. 这些方法处理参数验证,然后委托给派生类可重写的受保护方法、虚方法或抽象方法。The methods handle parameter validation and then delegate to protected, virtual or abstract methods that derived classes can override.

每个受保护的虚方法都自动与 IChannelFactory 接口的其他方法(包括状态转换方法)进行同步。Each of the protected virtual methods is automatically synchronized with respect to the other methods on the IChannelFactory interface (including the state transition methods). 这意味着,无需额外锁定即可确保该对象在方法体内的状态一致。This means that no additional locking is required to ensure that the object is in a consistent state inside the method body.

构造函数

ChannelFactoryBase()

初始化 ChannelFactoryBase 类的新实例。Initializes a new instance of the ChannelFactoryBase class.

ChannelFactoryBase(IDefaultCommunicationTimeouts)

使用指定的默认通信超时初始化 ChannelFactoryBase 类的新实例。Initializes a new instance of the ChannelFactoryBase class with specified default communication timeouts.

属性

DefaultCloseTimeout

获取为完成关闭操作提供的默认时间间隔。Gets the default interval of time provided for a close operation to complete.

DefaultOpenTimeout

获取为完成打开操作提供的默认时间间隔。Gets the default interval of time provided for an open operation to complete.

DefaultReceiveTimeout

获取为完成接收操作提供的默认时间间隔。Gets the default interval of time provided for a receive operation to complete.

DefaultSendTimeout

获取为完成发送操作提供的默认时间间隔。Gets the default interval of time provided for a send operation to complete.

IsDisposed

获取一个值,该值指示通信对象是否已被释放。Gets a value that indicates whether the communication object has been disposed.

(继承自 CommunicationObject)
State

获取指示通信对象当前状态的值。Gets a value that indicates the current state of the communication object.

(继承自 CommunicationObject)
ThisLock

获取在状态转换过程中保护类实例的相互排斥锁。Gets the mutually exclusive lock that protects the class instance during a state transition.

(继承自 CommunicationObject)

方法

Abort()

使通信对象立即从其当前状态转换到正在关闭状态。Causes a communication object to transition immediately from its current state into the closing state.

(继承自 CommunicationObject)
BeginClose(AsyncCallback, Object)

开始一个异步操作以关闭通信对象。Begins an asynchronous operation to close a communication object.

(继承自 CommunicationObject)
BeginClose(TimeSpan, AsyncCallback, Object)

开始一个异步操作以在指定超时内关闭通信对象。Begins an asynchronous operation to close a communication object with a specified timeout.

(继承自 CommunicationObject)
BeginOpen(AsyncCallback, Object)

开始一个异步操作以打开通信对象。Begins an asynchronous operation to open a communication object.

(继承自 CommunicationObject)
BeginOpen(TimeSpan, AsyncCallback, Object)

开始一个异步操作以在指定时间间隔内打开通信对象。Begins an asynchronous operation to open a communication object within a specified interval of time.

(继承自 CommunicationObject)
Close()

使通信对象从其当前状态转换到关闭状态。Causes a communication object to transition from its current state into the closed state.

(继承自 CommunicationObject)
Close(TimeSpan)

使通信对象在指定时间间隔内从当前状态转换到关闭状态。Causes a communication object to transition from its current state into the closed state within a specified interval of time.

(继承自 CommunicationObject)
EndClose(IAsyncResult)

完成一个异步操作以关闭通信对象。Completes an asynchronous operation to close a communication object.

(继承自 CommunicationObject)
EndOpen(IAsyncResult)

完成一个异步操作以打开通信对象。Completes an asynchronous operation to open a communication object.

(继承自 CommunicationObject)
Equals(Object)

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

(继承自 Object)
Fault()

使通信对象从其当前状态转换到出错状态。Causes a communication object to transition from its current state into the faulted state.

(继承自 CommunicationObject)
GetCommunicationObjectType()

获取通信对象的类型。Gets the type of communication object.

(继承自 CommunicationObject)
GetHashCode()

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

(继承自 Object)
GetProperty<T>()

从通道堆栈的适当层返回所请求的类型化对象(如果存在)。Returns a typed object requested, if present, from the appropriate layer in the channel stack.

GetType()

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

(继承自 Object)
MemberwiseClone()

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

(继承自 Object)
OnAbort()

在调用了一个同步中止操作,从而引起通信对象转换为关闭状态的情况下,该方法插入对通信对象的处理。Inserts processing on a communication object after it transitions to the closing state due to the invocation of a synchronous abort operation.

OnBeginClose(TimeSpan, AsyncCallback, Object)

开始一个异步操作来关闭工厂创建的每个通道。Begins an asynchronous operation to close each of the channels that were created by the factory.

OnBeginOpen(TimeSpan, AsyncCallback, Object)

在调用了异步打开操作,从而引起通信对象转换为正在打开状态的情况下,该方法将插入处理。Inserts processing on a communication object after it transitions to the opening state due to the invocation of an asynchronous open operation.

(继承自 CommunicationObject)
OnClose(TimeSpan)

在通信对象转换为打开状态(此过程必须在指定时间间隔内完成)后插入对通信对象的处理。Inserts processing on a communication object after it transitions into the opening state which must complete within a specified interval of time.

OnClosed()

在通信对象转换到正在关闭状态的过程中被调用。Invoked during the transition of a communication object into the closing state.

(继承自 CommunicationObject)
OnClosing()

在通信对象转换到正在关闭状态的过程中被调用。Invoked during the transition of a communication object into the closing state.

(继承自 CommunicationObject)
OnEndClose(IAsyncResult)

完成一个异步操作来关闭工厂打开的通道。Completes an asynchronous operation to close channels that were opened by the factory.

OnEndOpen(IAsyncResult)

在打开通信对象时完成一个异步操作。Completes an asynchronous operation on the open of a communication object.

(继承自 CommunicationObject)
OnFaulted()

在调用了同步错误操作,从而引起通信对象转换为出错状态的情况下,该方法插入对通信对象的处理。Inserts processing on a communication object after it transitions to the faulted state due to the invocation of a synchronous fault operation.

(继承自 CommunicationObject)
OnOpen(TimeSpan)

在通信对象转换为打开状态(此过程必须在指定时间间隔内完成)后插入对通信对象的处理。Inserts processing on a communication object after it transitions into the opening state which must complete within a specified interval of time.

(继承自 CommunicationObject)
OnOpened()

在通信对象转换到已打开状态的过程中被调用。Invoked during the transition of a communication object into the opened state.

(继承自 CommunicationObject)
OnOpening()

在通信对象转换到正在打开状态的过程中被调用。Invoked during the transition of a communication object into the opening state.

(继承自 CommunicationObject)
Open()

使通信对象从已创建状态转换到已打开状态。Causes a communication object to transition from the created state into the opened state.

(继承自 CommunicationObject)
Open(TimeSpan)

使通信对象在指定时间间隔内从已创建状态转换到已打开状态。Causes a communication object to transition from the created state into the opened state within a specified interval of time.

(继承自 CommunicationObject)
ThrowIfDisposed()

如果通信对象已释放,则引发异常。Throws an exception if the communication object is disposed.

(继承自 CommunicationObject)
ThrowIfDisposedOrImmutable()

如果通信对象的 State 属性未设置为 Created 状态,则引发异常。Throws an exception if the communication object the State property is not set to the Created state.

(继承自 CommunicationObject)
ThrowIfDisposedOrNotOpen()

如果通信对象未处于 Opened 状态,则引发异常。Throws an exception if the communication object is not in the Opened state.

(继承自 CommunicationObject)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

事件

Closed

当通信对象转换到已关闭状态时发生。Occurs when a communication object transitions into the closed state.

(继承自 CommunicationObject)
Closing

当通信对象转换到正在关闭状态时发生。Occurs when a communication object transitions into the closing state.

(继承自 CommunicationObject)
Faulted

在通信对象转换到出错状态时发生。Occurs when a communication object transitions into the faulted state.

(继承自 CommunicationObject)
Opened

当通信对象转换到已打开状态时发生。Occurs when a communication object transitions into the opened state.

(继承自 CommunicationObject)
Opening

当通信对象转换到正在打开状态时发生。Occurs when a communication object transitions into the opening state.

(继承自 CommunicationObject)

显式接口实现

IDefaultCommunicationTimeouts.CloseTimeout

获取 close 方法(由通信对象调用)在超时之前的时间间隔。Gets the interval of time after which the close method, invoked by a communication object, times out.

(继承自 ChannelManagerBase)
IDefaultCommunicationTimeouts.OpenTimeout

获取 open 方法(由通信对象调用)在超时之前的时间间隔。Gets the interval of time after which the open method, invoked by a communication object, times out.

(继承自 ChannelManagerBase)
IDefaultCommunicationTimeouts.ReceiveTimeout

获取 receive 方法(由通信对象调用)在超时之前的时间间隔。Gets the interval of time after which the receive method, invoked by a communication object, times out.

(继承自 ChannelManagerBase)
IDefaultCommunicationTimeouts.SendTimeout

获取 send 方法(由通信对象调用)在超时之前的时间间隔。Gets the interval of time after which the send method, invoked by a communication object, times out.

(继承自 ChannelManagerBase)

适用于