qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raj...@apache.org
Subject svn commit: r1068696 - /qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java
Date Wed, 09 Feb 2011 00:02:22 GMT
Author: rajith
Date: Wed Feb  9 00:02:21 2011
New Revision: 1068696

URL: http://svn.apache.org/viewvc?rev=1068696&view=rev
Log:
QPID-3042
The createSession method in Connection.java now waits until the connection state == OPEN before
it actually sends the session-attach on the wire.

Modified:
    qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java

Modified: qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java?rev=1068696&r1=1068695&r2=1068696&view=diff
==============================================================================
--- qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java (original)
+++ qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/transport/Connection.java Wed
Feb  9 00:02:21 2011
@@ -313,6 +313,17 @@ public class Connection extends Connecti
     {
         synchronized (lock)
         {
+            Waiter w = new Waiter(lock, timeout);
+            while (w.hasTime() && state != OPEN && error == null)
+            {
+                w.await();                
+            }
+            
+            if (state != OPEN)
+            {
+                throw new ConnectionException("Timed out waiting for connection to be ready.
Current state is :" + state);
+            }
+            
             Session ssn = _sessionFactory.newSession(this, name, expiry);
             sessions.put(name, ssn);
             map(ssn);



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message