/// <summary> /// Gets the instance. /// </summary> /// <returns></returns> public static ConnectionFactoryManager GetInstance() { if (_instance == null) { _instance = new ConnectionFactoryManager(); } return(_instance); }
/// <summary> /// Opens the connection to the message broker. /// </summary> /// <param name="uri">The URI.</param> /// <returns>An active connection to the ActiveMQ message broker specified by the URI; /// exceptions will be caught by the attached ExceptionListener.</returns> private IConnection OpenConnection(Uri uri) { IConnection connection = ConnectionFactoryManager.GetInstance().CreateConnection(uri); connection.ExceptionListener += OnExceptionThrown; connection.Start(); Tracer.Debug("Connection open"); return(connection); }
/// <summary> /// Initializes a new instance of the <see cref="NmsOutputChannel"/> class. /// </summary> /// <param name="factory">The factory that created the channel.</param> /// <param name="remoteAddress">The remote address of the channel.</param> /// <param name="via">The URI that contains the transport address to which messages are sent on the output channel.</param> /// <param name="bufferManager">The buffer manager.</param> /// <param name="encoderFactory">The encoder factory.</param> /// <param name="destination">The name of the ActiveMQ destination.</param> /// <param name="destinationType">The type of the ActiveMQ destination (either a queue or a topic, permanent or temporary).</param> public NmsOutputChannel(ChannelManagerBase factory, EndpointAddress remoteAddress, Uri via, BufferManager bufferManager, MessageEncoderFactory encoderFactory, string destination, DestinationType destinationType) : base(factory, remoteAddress, via, bufferManager, encoderFactory, destination, destinationType) { _connection = ConnectionFactoryManager.GetInstance().CreateConnection(via); _connection.Start(); }