/// <summary>
        /// Initialises an instance of the <see cref="AmqpConnection"/> class.
        /// </summary>
        /// <param name="logger">
        /// </param>
        /// <param name="registration">
        /// Details required to connect to the queued message server.
        /// </param>
        public AmqpConnection(ILogger logger,  RegistrationData registration)
        {
            registration.ShouldNotBeNull();
            logger.ShouldNotBeNull();

            m_Address = registration.Address;
            m_Logger = logger;
        }
        /// <summary>
        /// Builds an AMQP connection.
        /// </summary>
        /// <returns>
        /// An initialised instance of a <see cref="AmqpConnection"/> class.
        /// </returns>
        public AmqpConnection BuildConnection(QueueEndpointAddress endpointAddress, EventHandler closedEventHandler)
        {
            var configuration = new RegistrationData(endpointAddress);
            var logger = m_LogFactory.GetLogger(typeof (AmqpConnection));

            return new AmqpConnection(logger, configuration, closedEventHandler);
        }
        /// <summary>
        /// Initialises an instance of the <see cref="AmqpConnection"/> class.
        /// </summary>
        /// <param name="logger">
        /// </param>
        /// <param name="registration">
        /// Details required to connect to the queued message server.
        /// </param>
        /// <param name="onCloseEventHandler">
        /// Event handler to fire when the connection is closed.
        /// </param>
        public AmqpConnection(ILogger logger, RegistrationData registration, EventHandler onCloseEventHandler) : this(logger, registration)
        {
            onCloseEventHandler.ShouldNotBeNull();

            m_OnClosedConnection = onCloseEventHandler;
        }