Table of Contents

Class HandlerProcessorBase

Namespace
CarrotMQ.Core.MessageProcessing
Assembly
CarrotMQ.Core.dll

Base class for handler processors responsible for instantiating the associated message handlers .

public abstract class HandlerProcessorBase
Inheritance
HandlerProcessorBase
Inherited Members

Remarks

The HandlerProcessorBase class provides common functionality for creating metadata about handlers and handling messages.

Constructors

HandlerProcessorBase(string)

Initializes a new instance of the HandlerProcessorBase class.

protected HandlerProcessorBase(string handlerKey)

Parameters

handlerKey string

The unique key associated with the handler.

Exceptions

ArgumentException

Thrown if the handlerKey is null, empty, or consists only of white-space characters.

Methods

GetHandler<THandler, TMessage, TResponse>(IDependencyInjector)

Gets an instance of the specified handler type, using the scoped dependency injector.

protected static THandler GetHandler<THandler, TMessage, TResponse>(IDependencyInjector scopedDependencyInjector) where THandler : HandlerBase<TMessage, TResponse> where TMessage : _IMessage<TMessage, TResponse> where TResponse : class

Parameters

scopedDependencyInjector IDependencyInjector

The scoped dependency injector.

Returns

THandler

An instance of the specified handler type.

Type Parameters

THandler

The type of the handler to create.

TMessage

The type of the message the handler processes.

TResponse

The type of the response the handler generates.

Exceptions

InvalidOperationException

Thrown if no handler of the specified type could be instantiated.