C# Класс Spring.Messaging.Nms.Listener.AbstractMessageListenerContainer

Abstract base class for message listener containers. Can either host a standard NMS MessageListener or a Spring-specific ISessionAwareMessageListener
Наследование: Spring.Messaging.Nms.Listener.AbstractListenerContainer
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
ExecuteListener ( ISession session, IMessage message ) : void

Executes the specified listener, committing or rolling back the transaction afterwards (if necessary).

Защищенные методы

Метод Описание
CheckMessageListener ( object messageListener ) : void

Checks the message listener, throwing an exception if it does not correspond to a supported listener type. By default, only a standard JMS MessageListener object or a Spring ISessionAwareMessageListener object will be accepted.

CommitIfNecessary ( ISession session, IMessage message ) : void

Perform a commit or message acknowledgement, as appropriate

DoExecuteListener ( ISession session, IMessage message ) : void

Executes the specified listener, committing or rolling back the transaction afterwards (if necessary).

DoInvokeListener ( IMessageListener listener, IMessage message ) : void

Invoke the specified listener as standard JMS MessageListener.

Default implementation performs a plain invocation of the OnMessage methods

DoInvokeListener ( ISessionAwareMessageListener listener, ISession session, IMessage message ) : void

Invoke the specified listener as Spring SessionAwareMessageListener, exposing a new NMS Session (potentially with its own transaction) to the listener if demanded.

HandleListenerException ( Exception ex ) : void

Handle the given exception that arose during listener execution.

The default implementation logs the exception at error level, not propagating it to the JMS provider - assuming that all handling of acknowledgement and/or transactions is done by this listener container. This can be overridden in subclasses.

InvokeErrorHandler ( Exception exception ) : void

Invokes the error handler.

InvokeExceptionListener ( Exception ex ) : void

Invokes the registered exception listener, if any.

InvokeListener ( ISession session, IMessage message ) : void

Invokes the specified listener: either as standard NMS MessageListener or (preferably) as Spring SessionAwareMessageListener.

IsSessionLocallyTransacted ( ISession session ) : bool

Determines whether the given Session is locally transacted, that is, whether its transaction is managed by this listener container's Session handling and not by an external transaction coordinator.

The Session's own transacted flag will already have been checked before. This method is about finding out whether the Session's transaction is local or externally coordinated.

RollbackIfNecessary ( ISession session ) : void

Perform a rollback, if appropriate.

RollbackOnExceptionIfNecessary ( ISession session, Exception ex ) : void

Perform a rollback, handling rollback excepitons properly.

ValidateConfiguration ( ) : void

Validate that the destination is not null and that if the subscription is durable, then we are not using the Pub/Sub domain.

Описание методов

CheckMessageListener() защищенный Метод

Checks the message listener, throwing an exception if it does not correspond to a supported listener type. By default, only a standard JMS MessageListener object or a Spring ISessionAwareMessageListener object will be accepted.
protected CheckMessageListener ( object messageListener ) : void
messageListener object The message listener.
Результат void

CommitIfNecessary() защищенный Метод

Perform a commit or message acknowledgement, as appropriate
In case of commit failure
protected CommitIfNecessary ( ISession session, IMessage message ) : void
session ISession The session to commit.
message IMessage The message to acknowledge.
Результат void

DoExecuteListener() защищенный Метод

Executes the specified listener, committing or rolling back the transaction afterwards (if necessary).
If thrown by NMS API methods.
protected DoExecuteListener ( ISession session, IMessage message ) : void
session ISession The session to operate on.
message IMessage The received message.
Результат void

DoInvokeListener() защищенный Метод

Invoke the specified listener as standard JMS MessageListener.
Default implementation performs a plain invocation of the OnMessage methods
if thrown by the NMS API methods
protected DoInvokeListener ( IMessageListener listener, IMessage message ) : void
listener IMessageListener The listener to invoke.
message IMessage The received message.
Результат void

DoInvokeListener() защищенный Метод

Invoke the specified listener as Spring SessionAwareMessageListener, exposing a new NMS Session (potentially with its own transaction) to the listener if demanded.
If thrown by NMS API methods.
protected DoInvokeListener ( ISessionAwareMessageListener listener, ISession session, IMessage message ) : void
listener ISessionAwareMessageListener The Spring ISessionAwareMessageListener to invoke.
session ISession The session to operate on.
message IMessage The received message.
Результат void

ExecuteListener() публичный Метод

Executes the specified listener, committing or rolling back the transaction afterwards (if necessary).
public ExecuteListener ( ISession session, IMessage message ) : void
session ISession The session to operate on.
message IMessage The received message.
Результат void

HandleListenerException() защищенный Метод

Handle the given exception that arose during listener execution.
The default implementation logs the exception at error level, not propagating it to the JMS provider - assuming that all handling of acknowledgement and/or transactions is done by this listener container. This can be overridden in subclasses.
protected HandleListenerException ( Exception ex ) : void
ex System.Exception The exceptin to handle
Результат void

InvokeErrorHandler() защищенный Метод

Invokes the error handler.
protected InvokeErrorHandler ( Exception exception ) : void
exception System.Exception The exception.
Результат void

InvokeExceptionListener() защищенный Метод

Invokes the registered exception listener, if any.
protected InvokeExceptionListener ( Exception ex ) : void
ex System.Exception The exception that arose during NMS processing.
Результат void

InvokeListener() защищенный Метод

Invokes the specified listener: either as standard NMS MessageListener or (preferably) as Spring SessionAwareMessageListener.
If thrown by NMS API methods.
protected InvokeListener ( ISession session, IMessage message ) : void
session ISession The session to operate on.
message IMessage The received message.
Результат void

IsSessionLocallyTransacted() защищенный Метод

Determines whether the given Session is locally transacted, that is, whether its transaction is managed by this listener container's Session handling and not by an external transaction coordinator.
The Session's own transacted flag will already have been checked before. This method is about finding out whether the Session's transaction is local or externally coordinated.
protected IsSessionLocallyTransacted ( ISession session ) : bool
session ISession The session to check.
Результат bool

RollbackIfNecessary() защищенный Метод

Perform a rollback, if appropriate.
In case of a rollback error
protected RollbackIfNecessary ( ISession session ) : void
session ISession The session to rollback.
Результат void

RollbackOnExceptionIfNecessary() защищенный Метод

Perform a rollback, handling rollback excepitons properly.
in case of a rollback error.
protected RollbackOnExceptionIfNecessary ( ISession session, Exception ex ) : void
session ISession The session to rollback.
ex System.Exception The thrown application exception.
Результат void

ValidateConfiguration() защищенный Метод

Validate that the destination is not null and that if the subscription is durable, then we are not using the Pub/Sub domain.
protected ValidateConfiguration ( ) : void
Результат void