Exemple #1
0
                public Session(Connection connection, SessionInfo info, AcknowledgementMode acknowledgementMode)
                {
                        this.connection = connection;
                        this.info = info;
                        this.acknowledgementMode = acknowledgementMode;
						this.asyncSend = connection.AsyncSend;
                        transactionContext = new TransactionContext(this);
                        dispatchingThread = new DispatchingThread(new DispatchingThread.DispatchFunction(DispatchAsyncMessages));
                        dispatchingThread.ExceptionListener += new DispatchingThread.ExceptionHandler(dispatchingThread_ExceptionListener);
                }
        public IConnection CreateConnection(string userName, string password)
        {
            ConnectionInfo info = CreateConnectionInfo(userName, password);

            TcpTransportFactory tcpTransportFactory = new TcpTransportFactory();
			ITransport transport = tcpTransportFactory.CreateTransport(brokerUri);

            Connection connection = new Connection(transport, info);
			connection.ClientId = info.ClientId;

			// Set properties on connection using parameters prefixed with "jms."
			System.Collections.Specialized.StringDictionary map = URISupport.ParseQuery(brokerUri.Query);
			URISupport.SetProperties(connection, map, "jms.");

			return connection;
        }