Edit

Share via


ReceiveContext Class

Definition

Derive from this class to implement a custom state machine for receive context functionality.

public ref class ReceiveContext abstract
public abstract class ReceiveContext
type ReceiveContext = class
Public MustInherit Class ReceiveContext
Inheritance
ReceiveContext

Remarks

Receive context functionality is two-fold. When working with a queued channel, receive context allows you to lock a message prior to processing it. If a failure occurs, the message remains locked so that the service that is processing the message maintains ownership (another service cannot receive and process the same message) and may choose to perform some other action on it. When working with a one-way channel, receive context allows a service to control when it sends an acknowledgement message or it can indicate a problem by sending a negative acknowledgement message. The client can then choose to resend the message if it receives a negative acknowledgement or if it does not receive an acknowledgement within a certain period of time.

Constructors

ReceiveContext()

Initializes a new instance of the ReceiveContext class.

Fields

Name

The name of the receive context.

Properties

State

Gets or sets the state of the state machine.

ThisLock

An object used for locking the ReceiveContext instance.

Methods

Abandon(Exception, TimeSpan)

Causes the state machine to transition to the abandoned state with the specified exception and timeout value.

Abandon(TimeSpan)

Causes the state machine to transition to the abandoned state with the specified timeout value.

BeginAbandon(Exception, TimeSpan, AsyncCallback, Object)

Begins an asynchronous abandon operation with the specified exception, timeout, asynchronous callback, and user-defined state data.

BeginAbandon(TimeSpan, AsyncCallback, Object)

Begins an asynchronous abandon operation with the specified timeout, asynchronous callback, and user-defined state data.

BeginComplete(TimeSpan, AsyncCallback, Object)

Begins an asynchronous complete operation with the specified timeout, asynchronous callback, and user-defined state data.

Complete(TimeSpan)

Causes the state machine to transition to the completed state with the specified timeout value.

EndAbandon(IAsyncResult)

Completes an asynchronous abandon operation.

EndComplete(IAsyncResult)

Completes an asynchronous complete operation.

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
Fault()

Causes the state machine to transition to the faulted state.

GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
OnAbandon(Exception, TimeSpan)

Called when the state machine is transitioning to the abandoned state with the specified exception and timeout value.

OnAbandon(TimeSpan)

Called when the state machine is transitioning to the abandoned state with the specified timeout value.

OnBeginAbandon(Exception, TimeSpan, AsyncCallback, Object)

Called when the state machine is transitioning to the abandoned state asynchronously with the specified exception, timeout value, callback, and state data.

OnBeginAbandon(TimeSpan, AsyncCallback, Object)

Called when the state machine is transitioning to the abandoned state asynchronously with the specified timeout value, callback, and state data.

OnBeginComplete(TimeSpan, AsyncCallback, Object)

Called when the state machine is transitioning to the completed state asynchronously with the specified timeout, callback, and state data.

OnComplete(TimeSpan)

Called when the state machine is transitioning to the completed state with the specified timeout value.

OnEndAbandon(IAsyncResult)

Called when the state machine is transitioning to the abandoned state asynchronously.

OnEndComplete(IAsyncResult)

Called when the state machine is transitioning to the completed state asynchronously.

OnFaulted()

Called when the state machine is transitioning to the faulted state.

ToString()

Returns a string that represents the current object.

(Inherited from Object)
TryGet(Message, ReceiveContext)

Attempts to get the receive context from the specified message.

TryGet(MessageProperties, ReceiveContext)

Attempts to get the receive context from the specified message properties collection.

Events

Faulted

Defines the event to raised when an exception has occurred during the messaging process.

Applies to