Author: aconway
Date: Thu Jun 12 12:19:22 2008
New Revision: 667205

URL: http://svn.apache.org/viewvc?rev=667205&view=rev
Log:
Propagate error messages across the Demux between network & user threads.

Modified:
    incubator/qpid/trunk/qpid/cpp/etc/qpidd.conf
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/Demux.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/Demux.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h
    incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am

Modified: incubator/qpid/trunk/qpid/cpp/etc/qpidd.conf
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/etc/qpidd.conf?rev=667205&r1=667204&r2=667205&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/etc/qpidd.conf (original)
+++ incubator/qpid/trunk/qpid/cpp/etc/qpidd.conf Thu Jun 12 12:19:22 2008
@@ -1,2 +1,3 @@
-# Configuration file for qpidd.
-# Using default settings, qpidd --help to see defaults.
+# Configuration file for qpidd. Entries are of the form:
+#  name = value
+# Using default settings: "qpidd --help" or "man qpidd" for more details.

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/Demux.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/Demux.cpp?rev=667205&r1=667204&r2=667205&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/Demux.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/Demux.cpp Thu Jun 12 12:19:22 
2008
@@ -47,7 +47,7 @@
 
 Demux::Demux() : defaultQueue(new Queue()) {}
 
-Demux::~Demux() { close(); }
+Demux::~Demux() { close(sys::ExceptionHolder(new ClosedException())); }
 
 Demux::QueuePtr ScopedDivert::getQueue()
 {
@@ -69,13 +69,13 @@
     }
 }
 
-void Demux::close()
+void Demux::close(const sys::ExceptionHolder& ex)
 {
     sys::Mutex::ScopedLock l(lock);
     for (iterator i = records.begin(); i != records.end(); i++) {
-        i->queue->close();
+        i->queue->close(ex);
     }
-    defaultQueue->close();
+    defaultQueue->close(ex);
 }
 
 void Demux::open()

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/Demux.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/Demux.h?rev=667205&r1=667204&r2=667205&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/Demux.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/Demux.h Thu Jun 12 12:19:22 
2008
@@ -53,7 +53,7 @@
     ~Demux();
     
     void handle(framing::FrameSet::shared_ptr);
-    void close();
+    void close(const sys::ExceptionHolder& ex);
     void open();
 
     QueuePtr add(const std::string& name, Condition);

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp?rev=667205&r1=667204&r2=667205&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/SessionImpl.cpp Thu Jun 12 
12:19:22 2008
@@ -616,7 +616,9 @@
 
 void SessionImpl::handleClosed()
 {
-    demux.close();
+    // FIXME aconway 2008-06-12: needs to be set to the correct exception type.
+    // 
+    demux.close(sys::ExceptionHolder(text.empty() ? new ClosedException() : 
new Exception(text)));
     results.close();
 }
 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h?rev=667205&r1=667204&r2=667205&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/BlockingQueue.h Thu Jun 12 
12:19:22 2008
@@ -79,13 +79,14 @@
     }
 
     /**
-     * Close the queue. Throws ClosedException in threads waiting in pop().
-     * Blocks till all waiting threads have been notified.
+     * Close the queue.
+     [EMAIL PROTECTED] exception to throw to waiting threads. ClosedException 
by default.
      */ 
-    void close()
+    void close(const ExceptionHolder& ex=ExceptionHolder(new 
ClosedException()))
     {
         Waitable::ScopedLock l(lock);
         if (!closed) {
+            lock.setException(ex);
             closed = true;
             lock.notifyAll();
             lock.waitWaiters(); // Ensure no threads are still waiting.

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am?rev=667205&r1=667204&r2=667205&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/Makefile.am Thu Jun 12 12:19:22 2008
@@ -1,4 +1,4 @@
-AM_CXXFLAGS = $(WARNING_CFLAGS) $(CFLAGS)  $(APR_CXXFLAGS) 
-DBOOST_TEST_DYN_LINK
+AM_CXXFLAGS = $(WARNING_CFLAGS) -DBOOST_TEST_DYN_LINK
 INCLUDES =  -I$(srcdir)/.. -I$(srcdir)/../gen -I$(top_builddir)/src/gen
 
 [EMAIL PROTECTED]@


Reply via email to