Show / Hide Table of Contents

Class MessagingCommandProcessor

Command processor based on messaging. It packs the command line in messages and delegates execution to the IMessageProcessor.

Inheritance
System.Object
MessagingCommandProcessor
Implements
ICommandProcessor
Inherited Members
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.Application.Console
Assembly: Kephas.Application.Console.dll
Syntax
[OverridePriority(Priority.Low)]
public class MessagingCommandProcessor : ICommandProcessor

Constructors

| Improve this Doc View Source

MessagingCommandProcessor(ICommandRegistry, ICommandIdentityResolver, IMessageProcessor, IContextFactory)

Initializes a new instance of the MessagingCommandProcessor class.

Declaration
public MessagingCommandProcessor(ICommandRegistry registry, ICommandIdentityResolver identityResolver, IMessageProcessor messageProcessor, IContextFactory contextFactory)
Parameters
Type Name Description
ICommandRegistry registry

The registry.

ICommandIdentityResolver identityResolver

The identity resolver.

IMessageProcessor messageProcessor

The message processor.

IContextFactory contextFactory

The context factory.

Methods

| Improve this Doc View Source

CreateMessage(String, IExpando)

Creates the message from the command and the arguments.

Declaration
protected virtual IMessage CreateMessage(string command, IExpando args)
Parameters
Type Name Description
System.String command

The command.

IExpando args

The arguments.

Returns
Type Description
IMessage

The new message.

Exceptions
Type Condition
System.InvalidOperationException

Thrown when the requested operation is invalid.

| Improve this Doc View Source

GetMessageArguments(IExpando)

Gets message arguments.

Declaration
protected virtual IDictionary<string, object> GetMessageArguments(IExpando args)
Parameters
Type Name Description
IExpando args

The arguments.

Returns
Type Description
System.Collections.Generic.IDictionary<System.String, System.Object>

The message arguments.

| Improve this Doc View Source

HandleUnknownArgument(IMessage, ITypeInfo, Int32, String, Object)

Handles an argument that cannot be matched by name.

Declaration
protected virtual bool HandleUnknownArgument(IMessage message, ITypeInfo messageType, int index, string name, object value)
Parameters
Type Name Description
IMessage message

The message.

ITypeInfo messageType

Type of the message.

System.Int32 index

Zero-based index of the argument.

System.String name

The name.

System.Object value

The value.

Returns
Type Description
System.Boolean

True if it succeeds, false if it fails.

| Improve this Doc View Source

ProcessAsync(String, IExpando, CancellationToken)

Executes the asynchronous operation.

Declaration
public Task<object> ProcessAsync(string command, IExpando args = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.String command

The command.

IExpando args

Optional. The arguments.

System.Threading.CancellationToken cancellationToken

Optional. A token that allows processing to be cancelled.

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

The asynchronous result.

| Improve this Doc View Source

ProcessMessageAsync(IMessage, IExpando, CancellationToken)

Process the message asynchronously.

Declaration
protected virtual Task<object> ProcessMessageAsync(IMessage message, IExpando args, CancellationToken cancellationToken)
Parameters
Type Name Description
IMessage message

The message.

IExpando args

The arguments.

System.Threading.CancellationToken cancellationToken

A token that allows processing to be cancelled.

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

An asynchronous result that yields the process message.

| Improve this Doc View Source

SetPropertyValue(IMessage, IPropertyInfo, Object)

Sets the message property value.

Declaration
protected virtual void SetPropertyValue(IMessage message, IPropertyInfo propInfo, object value)
Parameters
Type Name Description
IMessage message

The message.

IPropertyInfo propInfo

Information describing the property.

System.Object value

The value.

Implements

ICommandProcessor

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)
EntityEntryExtensions.TryGetAttachedEntityEntry(Object)
  • Improve this Doc
  • View Source
Back to top Generated by DocFX