Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

SingleConnectionFactory Class

A ConnectionFactory adapter that returns the same Connection from all CreateConnection() calls, and ignores calls to Connection.Close(). According to the JMS Connection model, this is perfectly thread-safe. The shared Connection can be automatically recovered in case of an Exception.

For a list of all members of this type, see SingleConnectionFactory Members .

System.Object
   SingleConnectionFactory
      CachingConnectionFactory

[Visual Basic]
Public Class SingleConnectionFactory
    Implements IConnectionFactory, IExceptionListener, IInitializingObject, IDisposable
[C#]
public class SingleConnectionFactory : IConnectionFactory, IExceptionListener, IInitializingObject, IDisposable

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Remarks

You can either pass in a specific Connection directly or let this factory lazily create a Connection via a given target ConnectionFactory.

Useful for testing and in applications when you want to keep using the same Connection for multiple NmsTemplate calls, without having a pooling ConnectionFactory underneath. This may span any number of transactions, even concurrently executing transactions.

Note that Spring's message listener containers support the use of a shared Connection within each listener container instance. Using SingleConnectionFactory with a MessageListenerContainer only really makes sense for sharing a single Connection across multiple listener containers.

Requirements

Namespace: Spring.Messaging.Nms.Connections

Assembly: Spring.Messaging.Nms (in Spring.Messaging.Nms.dll)

See Also

SingleConnectionFactory Members | Spring.Messaging.Nms.Connections Namespace