Show / Hide Table of Contents

Class DefaultMessageProcessor

Provides the default implementation of the IMessageProcessor application service contract.

Inheritance
System.Object
Loggable
DefaultMessageProcessor
Implements
ILoggable
IMessageProcessor
Inherited Members
Loggable.Logger
Loggable.GetLogger()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Kephas.Messaging
Assembly: Kephas.Messaging.dll
Syntax
[OverridePriority(Priority.Low)]
public class DefaultMessageProcessor : Loggable, ILoggable, IMessageProcessor

Constructors

| Improve this Doc View Source

DefaultMessageProcessor(IContextFactory, IMessageHandlerRegistry, IMessageMatchService, IList<IExportFactory<IMessagingBehavior, MessagingBehaviorMetadata>>)

Initializes a new instance of the DefaultMessageProcessor class.

Declaration
public DefaultMessageProcessor(IContextFactory contextFactory, IMessageHandlerRegistry handlerRegistry, IMessageMatchService messageMatchService, IList<IExportFactory<IMessagingBehavior, MessagingBehaviorMetadata>> behaviorFactories)
Parameters
Type Name Description
IContextFactory contextFactory

The context factory.

IMessageHandlerRegistry handlerRegistry

The handler registry.

IMessageMatchService messageMatchService

The message match service.

System.Collections.Generic.IList<IExportFactory<IMessagingBehavior, MessagingBehaviorMetadata>> behaviorFactories

The behavior factories.

Properties

| Improve this Doc View Source

ContextFactory

Gets the context factory.

Declaration
public IContextFactory ContextFactory { get; }
Property Value
Type Description
IContextFactory

The context factory.

Methods

| Improve this Doc View Source

ApplyAfterProcessBehaviorsAsync(IEnumerable<IMessagingBehavior>, IMessagingContext, CancellationToken)

Applies the behaviors invoking the AfterProcessAsync(IMessagingContext, CancellationToken) asynchronously.

Declaration
protected virtual Task ApplyAfterProcessBehaviorsAsync(IEnumerable<IMessagingBehavior> reversedBehaviors, IMessagingContext context, CancellationToken token)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IMessagingBehavior> reversedBehaviors

The reversed behaviors.

IMessagingContext context

Context for the message processing.

System.Threading.CancellationToken token

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

An asynchronous result.

| Improve this Doc View Source

ApplyBeforeProcessBehaviorsAsync(IEnumerable<IMessagingBehavior>, IMessagingContext, CancellationToken)

Applies the behaviors invoking the BeforeProcessAsync(IMessagingContext, CancellationToken) asynchronously.

Declaration
protected virtual Task ApplyBeforeProcessBehaviorsAsync(IEnumerable<IMessagingBehavior> behaviors, IMessagingContext context, CancellationToken token)
Parameters
Type Name Description
System.Collections.Generic.IEnumerable<IMessagingBehavior> behaviors

The reversed behaviors.

IMessagingContext context

Context for the message processing.

System.Threading.CancellationToken token

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task

An asynchronous result.

| Improve this Doc View Source

CreateProcessingContext(IMessage, IMessagingContext)

Creates the processing context.

Declaration
protected virtual IMessagingContext CreateProcessingContext(IMessage message, IMessagingContext parentContext)
Parameters
Type Name Description
IMessage message

The message.

IMessagingContext parentContext

The parent context.

Returns
Type Description
IMessagingContext

The processing context.

| Improve this Doc View Source

GetOrderedBehaviors(IMessage)

Gets the ordered behaviors (direct and reversed) to be applied.

Declaration
protected virtual (IEnumerable<IMessagingBehavior> behaviors, IEnumerable<IMessagingBehavior> reversedBehaviors)GetOrderedBehaviors(IMessage message)
Parameters
Type Name Description
IMessage message

The message.

Returns
Type Description
System.ValueTuple<System.Collections.Generic.IEnumerable<IMessagingBehavior>, System.Collections.Generic.IEnumerable<IMessagingBehavior>>

An ordered list of behaviors which can be applied to the provided message, with their reversed counterpart.

| Improve this Doc View Source

ProcessAsync(IMessage, IMessagingContext, CancellationToken)

Processes the specified message asynchronously.

Declaration
public Task<IMessage> ProcessAsync(IMessage message, IMessagingContext context = null, CancellationToken token = default(CancellationToken))
Parameters
Type Name Description
IMessage message

The message.

IMessagingContext context

Context for the message processing.

System.Threading.CancellationToken token

The cancellation token.

Returns
Type Description
System.Threading.Tasks.Task<IMessage>

The response promise.

Implements

ILoggable
IMessageProcessor

Extension Methods

DynamicObjectExtensions.SetPropertyValue(Object, String, Object)
DynamicObjectExtensions.TrySetPropertyValue(Object, String, Object)
DynamicObjectExtensions.GetPropertyValue(Object, String)
DynamicObjectExtensions.TryGetPropertyValue(Object, String, out Object)
DynamicObjectExtensions.GetRuntimeTypeInfo(Object)
DynamicObjectExtensions.ToDynamic(Object)
DynamicObjectExtensions.ToExpando(Object)
BehaviorValue.ToBehaviorValue<TValue>(TValue)
CollectionExtensions.AddRange<T, TItem>(T, IEnumerable<TItem>)
LoggingExtensions.GetLogger(Object, IContext)
TypeExtensions.GetAbstractType(Object)
TypeExtensions.GetAbstractTypeInfo(Object)
ReflectionHelper.GetTypeInfo(Object)
MessageProcessorExtensions.ProcessAsync(IMessageProcessor, Object, IMessagingContext, CancellationToken)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX