You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2009/12/18 17:12:19 UTC

svn commit: r892292 [3/4] - in /qpid/branches/qmfv2/qpid: ./ bin/ cpp/ cpp/examples/ cpp/examples/messaging/ cpp/include/qmf/engine/ cpp/include/qpid/client/ cpp/include/qpid/messaging/ cpp/include/qpid/sys/ cpp/include/qpid/sys/windows/ cpp/src/ cpp/s...

Modified: qpid/branches/qmfv2/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/QueueObject.java
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/QueueObject.java?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/QueueObject.java (original)
+++ qpid/branches/qmfv2/qpid/java/management/tools/qpid-cli/src/org/apache/qpid/commands/objects/QueueObject.java Fri Dec 18 16:11:39 2009
@@ -22,10 +22,10 @@
 package org.apache.qpid.commands.objects;
 
 import javax.management.MBeanServerConnection;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanInfo;
 import javax.management.ObjectName;
 
+import org.apache.qpid.management.common.mbeans.ManagedQueue;
+
 public class QueueObject extends ObjectNames
 {
     public QueueObject(MBeanServerConnection mbsc)
@@ -47,33 +47,12 @@
 
     public int getmessagecount(ObjectName queue)
     {
-        int attr_count = 0;
-        String value;
-        Integer depth = null;
-
+        Number depth = null;
+        
         try
         {
-            MBeanInfo bean_info;
-            bean_info = mbsc.getMBeanInfo(queue);
-            MBeanAttributeInfo[] attr_info = bean_info.getAttributes();
-            if (attr_info == null)
-                return 0;
-            else
-            {
-                for (MBeanAttributeInfo attr : attr_info)
-                {
-                    Object toWrite = null;
-                    attr_count++;
-                    toWrite = mbsc.getAttribute(queue, attr.getName());
-                    if (attr_count == 7)
-                    {
-                        value = toWrite.toString();
-                        depth = new Integer(value);
-                    }
-                }
-
-            }
-
+            depth = (Number) mbsc.getAttribute(queue, ManagedQueue.ATTR_MSG_COUNT);
+            
         }
         catch (Exception ex)
         {

Propchange: qpid/branches/qmfv2/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java:443187-707694
 /qpid/branches/java-broker-0-10/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java:805429-821809
+/qpid/trunk/qpid/java/systests/src/main/java/org/apache/qpid/client/MultipleJCAProviderRegistrationTest.java:889312-892277

Modified: qpid/branches/qmfv2/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java (original)
+++ qpid/branches/qmfv2/qpid/java/systests/src/main/java/org/apache/qpid/server/queue/ProducerFlowControlTest.java Fri Dec 18 16:11:39 2009
@@ -407,6 +407,11 @@
         consumerConnection.start();
         
         consumer.receive();
+        
+        //perform a synchronous op on the connection
+        ((AMQSession) consumerSession).declareExchange(
+                new AMQShortString("amq.direct"), new AMQShortString("direct"), false);
+        
         assertFalse("Queue should not be overfull", queueMBean.isFlowOverfull());
         
         consumer.receive();

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/08StandaloneExcludes
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/08StandaloneExcludes:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/08StandaloneExcludes:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/08StandaloneExcludes:805429-821809
+/qpid/trunk/qpid/java/test-profiles/08StandaloneExcludes:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/CPPExcludes
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/010Excludes:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/010Excludes:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/010Excludes:805429-821809
+/qpid/trunk/qpid/java/test-profiles/CPPExcludes:889312-892277

Modified: qpid/branches/qmfv2/qpid/java/test-profiles/Excludes
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/java/test-profiles/Excludes?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/java/test-profiles/Excludes (original)
+++ qpid/branches/qmfv2/qpid/java/test-profiles/Excludes Fri Dec 18 16:11:39 2009
@@ -29,4 +29,10 @@
 org.apache.qpid.test.unit.ack.AcknowledgeAfterFailoverOnMessageTest#*
 org.apache.qpid.test.unit.ack.AcknowledgeAfterFailoverTest#*
 
-
+// The following tests exibit random failures and are temporarily excluded.
+// QPID-2224 Random Test failures - The test needs to be fixed.
+MINANetworkDriverTest#*
+// QPID-2225 Random Test failures against the in-vm broker.
+FailoverBeforeConsumingRecover#*
+// QPID-2262 Random test failures - The test needs to be fixed.
+SimpleACLTest#testClientPublishInvalidQueueSuccess

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/Excludes
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/Excludes:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/Excludes:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/Excludes:805429-821809
+/qpid/trunk/qpid/java/test-profiles/Excludes:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/JavaExcludes
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/08Excludes:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/08Excludes:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/08Excludes:805429-821809
+/qpid/trunk/qpid/java/test-profiles/JavaExcludes:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/JavaStandaloneExcludes
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/08StandaloneExcludes:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/08StandaloneExcludes:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/08StandaloneExcludes:805429-821809
+/qpid/trunk/qpid/java/test-profiles/JavaStandaloneExcludes:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/clean-dir
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/clean-dir:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/clean-dir:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/clean-dir:805429-821809
+/qpid/trunk/qpid/java/test-profiles/clean-dir:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/cpp.async.testprofile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/cpp.async.testprofile:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/cpp.async.testprofile:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/cpp.async.testprofile:805429-821809
+/qpid/trunk/qpid/java/test-profiles/cpp.async.testprofile:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/cpp.noprefetch.testprofile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/cpp.noprefetch.testprofile:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/cpp.noprefetch.testprofile:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/cpp.noprefetch.testprofile:805429-821809
+/qpid/trunk/qpid/java/test-profiles/cpp.noprefetch.testprofile:889312-892277

Modified: qpid/branches/qmfv2/qpid/java/test-profiles/cpp.testprofile
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/java/test-profiles/cpp.testprofile?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/java/test-profiles/cpp.testprofile (original)
+++ qpid/branches/qmfv2/qpid/java/test-profiles/cpp.testprofile Fri Dec 18 16:11:39 2009
@@ -15,5 +15,5 @@
 
 broker=${broker.executable} -p @PORT --data-dir ${build.data}/@PORT -t --auth no --no-module-dir ${broker.modules} ${broker.args}
 
-profile.excludes=010PrefetchExcludes 010TransientExcludes
-test.excludes=Excludes 010Excludes ${profile}.excludes ${profile.excludes} cpp.excludes
+profile.excludes=CPPPrefetchExcludes CPPTransientExcludes
+test.excludes=Excludes CPPExcludes ${profile}.excludes ${profile.excludes} cpp.excludes

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/cpp.testprofile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/cpp.testprofile:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/cpp.testprofile:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/cpp.testprofile:805429-821809
+/qpid/trunk/qpid/java/test-profiles/cpp.testprofile:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/default.testprofile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/default.testprofile:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/default.testprofile:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/default.testprofile:805429-821809
+/qpid/trunk/qpid/java/test-profiles/default.testprofile:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/java-derby.testprofile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/java-derby.testprofile:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/java-derby.testprofile:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/java-derby.testprofile:805429-821809
+/qpid/trunk/qpid/java/test-profiles/java-derby.testprofile:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/java.testprofile
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/java.testprofile:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/java.testprofile:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/java.testprofile:805429-821809
+/qpid/trunk/qpid/java/test-profiles/java.testprofile:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/log4j-test.xml
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/log4j-test.xml:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/log4j-test.xml:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/log4j-test.xml:805429-821809
+/qpid/trunk/qpid/java/test-profiles/log4j-test.xml:889312-892277

Propchange: qpid/branches/qmfv2/qpid/java/test-profiles/test-provider.properties
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -1,3 +1,4 @@
 /incubator/qpid/trunk/qpid/java/test-profiles/test-provider.properties:443187-726139
 /qpid/branches/java-broker-0-10/qpid/java/test-profiles/test-provider.properties:795950-829653
 /qpid/branches/java-network-refactor/qpid/java/test-profiles/test-provider.properties:805429-821809
+/qpid/trunk/qpid/java/test-profiles/test-provider.properties:889312-892277

Modified: qpid/branches/qmfv2/qpid/java/testkit/bin/setenv.sh
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/java/testkit/bin/setenv.sh?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/java/testkit/bin/setenv.sh (original)
+++ qpid/branches/qmfv2/qpid/java/testkit/bin/setenv.sh Fri Dec 18 16:11:39 2009
@@ -17,6 +17,10 @@
 # under the License.
 #
 
+# If QPIDD_EXEC ..etc is not set, it will first check to see
+# if this is run from a qpid svn check out, if not it will look
+# for installed rpms.
+
 abs_path()
 {
   D=`dirname "$1"`
@@ -25,24 +29,45 @@
 }
 
 # Environment for python tests
-test -d ../../../python || { echo "WARNING: skipping test, no python directory."; exit 0; }
-PYTHON_DIR=../../../python
-PYTHONPATH=$PYTHON_DIR:$PYTHON_DIR/qpid
+
+if [ -d ../../../python ] ; then
+   PYTHON_DIR=../../../python
+   PYTHONPATH=$PYTHON_DIR:$PYTHON_DIR/qpid
+elif [ -z `echo $PYTHONPATH | awk '$0 ~ /qpid/'` ]; then
+   echo "WARNING: skipping test, no qpid python scripts found ."; exit 0;
+fi          
+
 
 if [ "$QPIDD_EXEC" = "" ] ; then
-   test -x ../../../cpp/src/qpidd || { echo "WARNING: skipping test, QPIDD_EXEC not set and qpidd not found."; exit 0; }
-   QPIDD_EXEC=`abs_path "../../../cpp/src/qpidd"`
-   #QPIDD_EXEC=/opt/workspace/qpid/trunk/qpid/cpp/src/.libs/lt-qpidd
+   if [ -x ../../../cpp/src/qpidd ]; then
+      QPIDD_EXEC=`abs_path "../../../cpp/src/qpidd"`
+   elif [ -n "$(which qpidd)" ] ; then
+      QPIDD_EXEC=$(which qpidd)   
+   else
+      echo "WARNING: skipping test, QPIDD_EXEC not set and qpidd not found."; exit 0;
+   fi
 fi
 
 if [ "$CLUSTER_LIB" = "" ] ; then
-   test -x ../../../cpp/src/.libs/cluster.so || { echo "WARNING: skipping test, CLUSTER_LIB not set and cluster.so not found."; exit 0; }
-   CLUSTER_LIB=`abs_path "../../../cpp/src/.libs/cluster.so"`
-   #CLUSTER_LIB=/opt/workspace/qpid/trunk/qpid/cpp/src/.libs/cluster.so
+   if [ -x ../../../cpp/src/.libs/cluster.so ]; then
+      CLUSTER_LIB=`abs_path "../../../cpp/src/.libs/cluster.so"`
+   elif [ -e /usr/lib64/qpid/daemon/cluster.so ] ; then
+      CLUSTER_LIB="/usr/lib64/qpid/daemon/cluster.so"
+   elif [ -e /usr/lib/qpid/daemon/cluster.so ] ; then 
+      CLUSTER_LIB="/usr/lib/qpid/daemon/cluster.so"
+   else
+     echo "WARNING: skipping test, CLUSTER_LIB not set and cluster.so not found."; exit 0;
+   fi
 fi
 
 if [ "$QP_CP" = "" ] ; then
-   QP_JAR_PATH=`abs_path "../../build/lib/"`
+   if [ -d ../../build/lib/ ]; then
+      QP_JAR_PATH=`abs_path "../../build/lib/"`
+   elif [ -d /usr/share/java/qpid-deps ]; then
+      QP_JAR_PATH=`abs_path "/usr/share/java"`
+   else
+      "WARNING: skipping test, QP_CP not set and the Qpid jars are not present."; exit 0; 	
+   fi
    QP_CP=`find $QP_JAR_PATH -name '*.jar' | tr '\n' ':'`
 fi
 
@@ -50,5 +75,4 @@
    OUTDIR=`abs_path "../output"`
 fi
 
-
 export PYTHONPATH PYTHON_DIR QPIDD_EXEC CLUSTER_LIB QP_CP OUTDIR

Modified: qpid/branches/qmfv2/qpid/python/Makefile
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/python/Makefile?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/python/Makefile (original)
+++ qpid/branches/qmfv2/qpid/python/Makefile Fri Dec 18 16:11:39 2009
@@ -50,7 +50,7 @@
 
 doc:
 	@mkdir -p $(BUILD)
-	epydoc qpid.messaging -o $(BUILD)/doc --no-private --no-sourcecode --include-log
+	PYTHONPATH=. epydoc qpid.messaging -o $(BUILD)/doc --no-private --no-sourcecode --include-log
 	epydoc qmf.qmfCommon qmf.qmfConsole -o $(BUILD)/doc/qmf --no-private --no-sourcecode --include-log
 
 install: build

Propchange: qpid/branches/qmfv2/qpid/python/examples/api/spout
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -0,0 +1 @@
+/qpid/trunk/qpid/python/examples/api/spout:889312-892277

Modified: qpid/branches/qmfv2/qpid/python/qpid/address.py
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/python/qpid/address.py?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/python/qpid/address.py (original)
+++ qpid/branches/qmfv2/qpid/python/qpid/address.py Fri Dec 18 16:11:39 2009
@@ -24,6 +24,8 @@
 
 LBRACE = l.define("LBRACE", r"\{")
 RBRACE = l.define("RBRACE", r"\}")
+LBRACK = l.define("LBRACK", r"\[")
+RBRACK = l.define("RBRACK", r"\]")
 COLON = l.define("COLON", r":")
 SEMI = l.define("SEMI", r";")
 SLASH = l.define("SLASH", r"/")
@@ -128,8 +130,30 @@
       return tok2obj(self.eat())
     elif self.matches(LBRACE):
       return self.map()
+    elif self.matches(LBRACK):
+      return self.list()
     else:
-      raise ParseError(self.next(), NUMBER, STRING, ID, LBRACE)
+      raise ParseError(self.next(), NUMBER, STRING, ID, LBRACE, LBRACK)
+
+  def list(self):
+    self.eat(LBRACK)
+
+    result = []
+
+    while True:
+      if self.matches(RBRACK):
+        break
+      else:
+        result.append(self.value())
+        if self.matches(COMMA):
+          self.eat(COMMA)
+        elif self.matches(RBRACK):
+          break
+        else:
+          raise ParseError(self.next(), COMMA, RBRACK)
+
+    self.eat(RBRACK)
+    return result
 
 def parse(addr):
   return AddressParser(lex(addr)).parse()

Modified: qpid/branches/qmfv2/qpid/python/qpid/brokertest.py
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/python/qpid/brokertest.py?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/python/qpid/brokertest.py (original)
+++ qpid/branches/qmfv2/qpid/python/qpid/brokertest.py Fri Dec 18 16:11:39 2009
@@ -259,15 +259,15 @@
         self.args += [ "--load-module", BrokerTest.cluster_lib ]
         self.start_n(count, expect=expect, wait=wait)
 
-    def start(self, name=None, expect=EXPECT_RUNNING, wait=True):
+    def start(self, name=None, expect=EXPECT_RUNNING, wait=True, args=[]):
         """Add a broker to the cluster. Returns the index of the new broker."""
         if not name: name="%s-%d" % (self.name, len(self._brokers))
         log.debug("Cluster %s starting member %s" % (self.name, name))
-        self._brokers.append(self.test.broker(self.args, name, expect, wait))
+        self._brokers.append(self.test.broker(self.args+args, name, expect, wait))
         return self._brokers[-1]
 
-    def start_n(self, count, expect=EXPECT_RUNNING, wait=True):
-        for i in range(count): self.start(expect=expect, wait=wait)
+    def start_n(self, count, expect=EXPECT_RUNNING, wait=True, args=[]):
+        for i in range(count): self.start(expect=expect, wait=wait, args=args)
 
     # Behave like a list of brokers.
     def __len__(self): return len(self._brokers)
@@ -289,6 +289,7 @@
     receiver_exec = os.getenv("RECEIVER_EXEC")
     sender_exec = os.getenv("SENDER_EXEC")
     store_lib = os.getenv("STORE_LIB")
+    test_store_lib = os.getenv("TEST_STORE_LIB")
     rootdir = os.getcwd()
 
     def configure(self, config): self.config=config

Propchange: qpid/branches/qmfv2/qpid/python/qpid/concurrency.py
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -0,0 +1 @@
+/qpid/trunk/qpid/python/qpid/concurrency.py:889312-892277

Modified: qpid/branches/qmfv2/qpid/python/qpid/driver.py
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/python/qpid/driver.py?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/python/qpid/driver.py (original)
+++ qpid/branches/qmfv2/qpid/python/qpid/driver.py Fri Dec 18 16:11:39 2009
@@ -605,6 +605,7 @@
       cmd = ExchangeDeclare(exchange=name, durable=durable)
     elif type == "queue":
       cmd = QueueDeclare(queue=name, durable=durable)
+      bindings = xprops.pop("bindings", [])
     else:
       return ("unrecognized type, must be topic or queue: %s" % type,)
 
@@ -621,9 +622,20 @@
     else:
       subtype = None
 
+    cmds = [cmd]
+    if type == "queue":
+      for b in bindings:
+        try:
+          n, s, o = address.parse(b)
+        except address.ParseError, e:
+          return (e,)
+        cmds.append(ExchangeBind(name, n, s, o))
+
+    for c in cmds[:-1]:
+      sst.write_cmd(c)
     def do_action():
       action(type, subtype)
-    sst.write_cmd(cmd, do_action)
+    sst.write_cmd(cmds[-1], do_action)
 
   def delete(self, sst, name, action):
     def do_delete(er, qr):
@@ -840,6 +852,7 @@
       msg.reply_to = reply_to2addr(mp.reply_to)
     msg.correlation_id = mp.correlation_id
     msg.durable = dp.delivery_mode == delivery_mode.persistent
+    msg.redelivered = dp.redelivered
     msg.properties = mp.application_headers
     msg.content_type = mp.content_type
     msg._transfer_id = xfr.id

Modified: qpid/branches/qmfv2/qpid/python/qpid/messaging.py
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/python/qpid/messaging.py?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/python/qpid/messaging.py (original)
+++ qpid/branches/qmfv2/qpid/python/qpid/messaging.py Fri Dec 18 16:11:39 2009
@@ -787,6 +787,7 @@
     self.reply_to = reply_to
     self.correlation_id = correlation_id
     self.durable = durable
+    self.redelivered = False
     if properties is None:
       self.properties = {}
     else:

Modified: qpid/branches/qmfv2/qpid/python/qpid/tests/address.py
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/python/qpid/tests/address.py?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/python/qpid/tests/address.py (original)
+++ qpid/branches/qmfv2/qpid/python/qpid/tests/address.py Fri Dec 18 16:11:39 2009
@@ -145,7 +145,7 @@
 
   def testBadOptions3(self):
     self.invalid("name/subject; { key:",
-                 "expecting (NUMBER, STRING, ID, LBRACE), got EOF "
+                 "expecting (NUMBER, STRING, ID, LBRACE, LBRACK), got EOF "
                  "line:1,20:name/subject; { key:")
 
   def testBadOptions4(self):
@@ -167,3 +167,33 @@
     self.invalid("name/subject; { key: value } asdf",
                  "expecting EOF, got ID('asdf') "
                  "line:1,29:name/subject; { key: value } asdf")
+
+  def testList1(self):
+    self.valid("name/subject; { key: [] }", "name", "subject", {"key": []})
+
+  def testList2(self):
+    self.valid("name/subject; { key: ['one'] }", "name", "subject", {"key": ['one']})
+
+  def testList3(self):
+    self.valid("name/subject; { key: [1, 2, 3] }", "name", "subject",
+               {"key": [1, 2, 3]})
+
+  def testList4(self):
+    self.valid("name/subject; { key: [1, [2, 3], 4] }", "name", "subject",
+               {"key": [1, [2, 3], 4]})
+
+  def testBadList1(self):
+    self.invalid("name/subject; { key: [ }", "expecting (NUMBER, STRING, ID, LBRACE, LBRACK), "
+                 "got RBRACE('}') line:1,23:name/subject; { key: [ }")
+
+  def testBadList2(self):
+    self.invalid("name/subject; { key: [ 1 }", "expecting (COMMA, RBRACK), "
+                 "got RBRACE('}') line:1,25:name/subject; { key: [ 1 }")
+
+  def testBadList3(self):
+    self.invalid("name/subject; { key: [ 1 2 }", "expecting (COMMA, RBRACK), "
+                 "got NUMBER('2') line:1,25:name/subject; { key: [ 1 2 }")
+
+  def testBadList4(self):
+    self.invalid("name/subject; { key: [ 1 2 ] }", "expecting (COMMA, RBRACK), "
+                 "got NUMBER('2') line:1,25:name/subject; { key: [ 1 2 ] }")

Modified: qpid/branches/qmfv2/qpid/python/qpid/tests/messaging.py
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/python/qpid/tests/messaging.py?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/python/qpid/tests/messaging.py (original)
+++ qpid/branches/qmfv2/qpid/python/qpid/tests/messaging.py Fri Dec 18 16:11:39 2009
@@ -642,6 +642,28 @@
     # XXX: need to figure out close after error
     self.conn._remove_session(self.ssn)
 
+  def testBindings(self):
+    snd = self.ssn.sender("""
+test-bindings-queue; {
+  create: always,
+  delete: always,
+  node-properties: {
+    x-properties: {
+      bindings: ["amq.topic/a.#", "amq.direct/b", "amq.topic/c.*"]
+    }
+  }
+}
+""")
+    snd.send("one")
+    snd_a = self.ssn.sender("amq.topic/a.foo")
+    snd_b = self.ssn.sender("amq.direct/b")
+    snd_c = self.ssn.sender("amq.topic/c.bar")
+    snd_a.send("two")
+    snd_b.send("three")
+    snd_c.send("four")
+    rcv = self.ssn.receiver("test-bindings-queue")
+    self.drain(rcv, expected=["one", "two", "three", "four"])
+
 NOSUCH_Q = "this-queue-should-not-exist"
 UNPARSEABLE_ADDR = "name/subject; {bad options"
 UNLEXABLE_ADDR = "\0x0\0x1\0x2\0x3"

Propchange: qpid/branches/qmfv2/qpid/python/tests_0-9/queue.py
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -0,0 +1 @@
+/qpid/trunk/qpid/python/tests_0-9/queue.py:889312-892277

Modified: qpid/branches/qmfv2/qpid/python/todo.txt
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/python/todo.txt?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/python/todo.txt (original)
+++ qpid/branches/qmfv2/qpid/python/todo.txt Fri Dec 18 16:11:39 2009
@@ -44,12 +44,6 @@
 
     - connected: F, NR
 
-    - start: F, NR, ND
-      + see comment on Receiver.start
-
-    - stop: F, NR, ND
-      + see comment on Receiver.start
-
     - close: F, NR, ND
       + currently there is no distinction between a "close" that does
         a complete handshake with the remote broker, and a "close"
@@ -90,16 +84,7 @@
 
     - rollback: F, NR
 
-    - start: F, NR, ND
-      + see comment on Receiver.start
-
-    - stop: F, NR, ND
-      + see comment on Receiver.start
-
-    - fetch: NF
-      + this method if added would permit the listener functionality
-        to be removed as it would become trivial to replicate via user
-        code
+    - next_receiver: F, NR
 
     - close: F, ND
       + see comment on Connection.close
@@ -146,18 +131,6 @@
       + changing capacity/prefetch to issue credit on ack rather than
         fetch return
 
-    - start: F, NR, ND
-      + when a receiver is "stopped", it is treated as if the receiver
-        has zero capacity even if the capacity field is set to a non
-        zero value, this is a mild convenience since you can stop and
-        then start a receiver without having to remember what the
-        capacity was before, however it is unclear if this is really
-        worthwhile since stop/start is entirely equivalent to setting
-        capacity to a zero/non-zero value
-
-    - stop: F, NR, ND
-      + see comment on Receiver.start
-
     - sync/wait: NF
 
     - close: F, NR
@@ -185,10 +158,10 @@
 Address:
 
   - syntax: F, NR
-  - subject related changes, e.g. allowing patterns on both ends: NF, ND
-  - creating/deleting queues/exchanges
-    + need to handle cleanup of temp queues/topics: NF
-    + passthrough options for creating exchanges/queues: NF
+  - subject related changes, e.g. allowing patterns on both ends: NF
+  - creating/deleting queues/exchanges F, NR
+    + need to handle cleanup of temp queues/topics: F, NR
+    + passthrough options for creating exchanges/queues: F, NR
   - integration with java: NF
   - queue browsing: NF
   - temporary queues: NF

Propchange: qpid/branches/qmfv2/qpid/ruby/ext/sasl/extconf.rb
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 16:11:39 2009
@@ -0,0 +1 @@
+/qpid/trunk/qpid/ruby/ext/sasl/extconf.rb:889312-892277

Modified: qpid/branches/qmfv2/qpid/wcf/QpidWcf.sln
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/QpidWcf.sln?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/QpidWcf.sln (original)
+++ qpid/branches/qmfv2/qpid/wcf/QpidWcf.sln Fri Dec 18 16:11:39 2009
@@ -34,79 +34,44 @@
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
-		Debug|Any CPU = Debug|Any CPU
-		Debug|Mixed Platforms = Debug|Mixed Platforms
 		Debug|Win32 = Debug|Win32
 		Debug|x64 = Debug|x64
-		Debug|x86 = Debug|x86
-		Release|Any CPU = Release|Any CPU
-		Release|Mixed Platforms = Release|Mixed Platforms
 		Release|Win32 = Release|Win32
 		Release|x64 = Release|x64
-		Release|x86 = Release|x86
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
 		{820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|Win32.Build.0 = Debug|Any CPU
 		{820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{820BFC34-A40F-46BA-B86B-05334854CA17}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{820BFC34-A40F-46BA-B86B-05334854CA17}.Release|Any CPU.Build.0 = Release|Any CPU
-		{820BFC34-A40F-46BA-B86B-05334854CA17}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{820BFC34-A40F-46BA-B86B-05334854CA17}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|x64.Build.0 = Debug|Any CPU
 		{820BFC34-A40F-46BA-B86B-05334854CA17}.Release|Win32.ActiveCfg = Release|Any CPU
+		{820BFC34-A40F-46BA-B86B-05334854CA17}.Release|Win32.Build.0 = Release|Any CPU
 		{820BFC34-A40F-46BA-B86B-05334854CA17}.Release|x64.ActiveCfg = Release|Any CPU
-		{820BFC34-A40F-46BA-B86B-05334854CA17}.Release|x86.ActiveCfg = Release|Any CPU
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|Any CPU.ActiveCfg = Debug|Win32
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|Any CPU.Build.0 = Debug|Win32
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|Mixed Platforms.Build.0 = Debug|Win32
+		{820BFC34-A40F-46BA-B86B-05334854CA17}.Release|x64.Build.0 = Release|Any CPU
 		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|Win32.ActiveCfg = Debug|Win32
 		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|Win32.Build.0 = Debug|Win32
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|x64.ActiveCfg = Debug|Win32
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|x86.ActiveCfg = Debug|Win32
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|Any CPU.ActiveCfg = Release|Win32
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|Mixed Platforms.ActiveCfg = Release|Win32
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|Mixed Platforms.Build.0 = Release|Win32
+		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|x64.ActiveCfg = Debug|x64
+		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|x64.Build.0 = Debug|x64
 		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|Win32.ActiveCfg = Release|Win32
 		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|Win32.Build.0 = Release|Win32
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|x64.ActiveCfg = Release|Win32
-		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|x86.ActiveCfg = Release|Win32
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|x64.ActiveCfg = Release|x64
+		{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|x64.Build.0 = Release|x64
 		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|Win32.Build.0 = Debug|Any CPU
 		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|x64.ActiveCfg = Debug|Any CPU
 		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|x64.Build.0 = Debug|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|x86.Build.0 = Debug|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|Any CPU.Build.0 = Release|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
 		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|Win32.ActiveCfg = Release|Any CPU
+		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|Win32.Build.0 = Release|Any CPU
 		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|x64.ActiveCfg = Release|Any CPU
 		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|x64.Build.0 = Release|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|x86.ActiveCfg = Release|Any CPU
-		{E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|x86.Build.0 = Release|Any CPU
-		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
-		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
 		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|Win32.ActiveCfg = Debug|Any CPU
+		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|Win32.Build.0 = Debug|Any CPU
 		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|x64.ActiveCfg = Debug|Any CPU
-		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|x86.ActiveCfg = Debug|Any CPU
-		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|Any CPU.Build.0 = Release|Any CPU
-		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
-		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|x64.Build.0 = Debug|Any CPU
 		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|Win32.ActiveCfg = Release|Any CPU
+		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|Win32.Build.0 = Release|Any CPU
 		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|x64.ActiveCfg = Release|Any CPU
-		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|x86.ActiveCfg = Release|Any CPU
+		{8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|x64.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpTypes.csproj
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpTypes.csproj?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpTypes.csproj (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpTypes.csproj Fri Dec 18 16:11:39 2009
@@ -153,6 +153,6 @@
 del $(AssemblyName).dll
 del $(AssemblyName).pdb
 cd "$(ProjectDir)"
-CreateNetModule.bat</PostBuildEvent>
+CreateNetModule.bat $(ConfigurationName)</PostBuildEvent>
   </PropertyGroup>
 </Project>
\ No newline at end of file

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/AmqpTypes/CreateNetModule.bat
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/AmqpTypes/CreateNetModule.bat?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/AmqpTypes/CreateNetModule.bat (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/AmqpTypes/CreateNetModule.bat Fri Dec 18 16:11:39 2009
@@ -16,4 +16,18 @@
 REM specific language governing permissions and limitations
 REM under the License.
 
-%systemroot%\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:%systemroot%\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:%systemroot%\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:%systemroot%\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\Apache.Qpid.AmqpTypes.netmodule /target:module *.cs
\ No newline at end of file
+if %1 == Release goto release
+
+echo generating Debug netmodule
+
+%systemroot%\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:%systemroot%\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:%systemroot%\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:%systemroot%\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\Apache.Qpid.AmqpTypes.netmodule /target:module *.cs
+
+goto end
+
+:release
+
+echo generating Release netmodule
+
+%systemroot%\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /keyfile:..\..\..\wcfnet.snk /optimize+  /out:obj\Release\Apache.Qpid.AmqpTypes.netmodule /target:module *.cs
+
+:end
\ No newline at end of file

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelFactory.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelFactory.cs?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelFactory.cs (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelFactory.cs Fri Dec 18 16:11:39 2009
@@ -32,7 +32,8 @@
         AmqpChannelProperties channelProperties;
         long maxBufferPoolSize;
         bool shared;
-	int prefetchLimit;
+	    int prefetchLimit;
+        List<AmqpTransportChannel> openChannels;
 
         internal AmqpChannelFactory(AmqpTransportBindingElement bindingElement, BindingContext context)
             : base(context.Binding)
@@ -45,7 +46,7 @@
             Collection<MessageEncodingBindingElement> messageEncoderBindingElements
                 = context.BindingParameters.FindAll<MessageEncodingBindingElement>();
 
-            if(messageEncoderBindingElements.Count > 1)
+            if (messageEncoderBindingElements.Count > 1)
             {
                 throw new InvalidOperationException("More than one MessageEncodingBindingElement was found in the BindingParameters of the BindingContext");
             }
@@ -57,6 +58,8 @@
             {
                 this.messageEncoderFactory = new TextMessageEncodingBindingElement().CreateMessageEncoderFactory();
             }
+
+            openChannels = new List<AmqpTransportChannel>();
         }
 
 
@@ -93,8 +96,42 @@
 
         protected override TChannel OnCreateChannel(EndpointAddress remoteAddress, Uri via)
         {
-            return (TChannel)(object) new AmqpTransportChannel(this, this.channelProperties, remoteAddress, this.messageEncoderFactory.Encoder, this.maxBufferPoolSize, this.shared, this.prefetchLimit);
+            AmqpTransportChannel channel = new AmqpTransportChannel(this, this.channelProperties, remoteAddress, this.messageEncoderFactory.Encoder, this.maxBufferPoolSize, this.shared, this.prefetchLimit);
+            lock (openChannels)
+            {
+                channel.Closed += new EventHandler(channel_Closed);
+                openChannels.Add(channel);
+            }
+            return (TChannel)(object) channel;
         }
 
+        void channel_Closed(object sender, EventArgs e)
+        {
+            if (this.State != CommunicationState.Opened)
+            {
+                return;
+            }
+
+            lock (openChannels)
+            {
+                AmqpTransportChannel channel = (AmqpTransportChannel)sender;
+                if (openChannels.Contains(channel))
+                {
+                    openChannels.Remove(channel);
+                }
+            }
+        }
+
+        protected override void OnClose(TimeSpan timeout)
+        {
+            base.OnClose(timeout);
+            lock (openChannels)
+            {
+                foreach (AmqpTransportChannel channel in openChannels)
+                {
+                    channel.Close(timeout);
+                }
+            }
+        }
     }
 }

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelListener.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelListener.cs?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelListener.cs (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelListener.cs Fri Dec 18 16:11:39 2009
@@ -130,15 +130,21 @@
 
         protected override IInputChannel OnAcceptChannel(TimeSpan timeout)
         {
+            if (this.IsDisposed)
+            {
+                return null;
+            }
+
             if (amqpTransportChannel == null)
             {
+                // TODO: add timeout processing
                 amqpTransportChannel = new AmqpTransportChannel(this, this.channelProperties,
                         new EndpointAddress(uri), messageEncoderFactory.Encoder,
                         maxBufferPoolSize, this.shared, this.prefetchLimit);
-                return (IInputChannel)(object) amqpTransportChannel;
+                return (IInputChannel)(object)amqpTransportChannel;
             }
 
-            // TODO: remove "max one channel" restriction,  add timeout processing
+            // Singleton channel.  Subsequent Accepts wait until the listener is closed
             acceptWaitEvent.WaitOne();
             return null;
         }
@@ -155,7 +161,11 @@
 
         protected override void OnClose(TimeSpan timeout)
         {
-            // TODO: (+ OnAbort)
+            if (amqpTransportChannel != null)
+            {
+                amqpTransportChannel.Close();
+            }
+            acceptWaitEvent.Set();
         }
 
         protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state)
@@ -170,7 +180,9 @@
 
         protected override void OnAbort()
         {
-            // TODO:
+            if (amqpTransportChannel != null)
+                amqpTransportChannel.Abort();
+            acceptWaitEvent.Set();
         }
     }
 }

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportBindingElement.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportBindingElement.cs?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportBindingElement.cs (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportBindingElement.cs Fri Dec 18 16:11:39 2009
@@ -25,7 +25,7 @@
     using System.ServiceModel.Description;
     using Apache.Qpid.AmqpTypes;
 
-    public class AmqpTransportBindingElement : TransportBindingElement
+    public class AmqpTransportBindingElement : TransportBindingElement, ITransactedBindingElement
     {
         AmqpChannelProperties channelProperties;
         bool shared;
@@ -112,6 +112,11 @@
             set { this.shared = value; }
         }
 
+        public bool TransactedReceiveEnabled
+        {
+            get { return true; }
+        }
+
         public TransferMode TransferMode
         {
             get { return this.channelProperties.TransferMode; }

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportChannel.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportChannel.cs?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportChannel.cs (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportChannel.cs Fri Dec 18 16:11:39 2009
@@ -278,7 +278,6 @@
 
         public bool TryReceive(TimeSpan timeout, out Message message)
         {
-            this.ThrowIfDisposedOrNotOpen();
             AmqpMessage amqpMessage;
             message = null;
 
@@ -379,6 +378,7 @@
         protected override void OnAbort()
         {
             //// TODO: check for network-less qpid teardown or launch special thread
+            this.CloseEndPoint();
             this.Cleanup();
         }
 

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/Channel.csproj
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/Channel.csproj?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/Channel.csproj (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Channel/Channel.csproj Fri Dec 18 16:11:39 2009
@@ -90,6 +90,7 @@
     <Reference Include="System.ServiceModel">
       <RequiredTargetFramework>3.0</RequiredTargetFramework>
     </Reference>
+    <Reference Include="System.Transactions" />
     <Reference Include="System.XML" />
   </ItemGroup>
   <ItemGroup>

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.cpp?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.cpp (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.cpp Fri Dec 18 16:11:39 2009
@@ -19,6 +19,7 @@
 
 #include <windows.h>
 #include <msclr\lock.h>
+#include <oletx2xa.h>
 
 #include "qpid/client/AsyncSession.h"
 #include "qpid/client/SubscriptionManager.h"
@@ -31,6 +32,8 @@
 #include "AmqpSession.h"
 #include "QpidMarshal.h"
 #include "QpidException.h"
+#include "DtxResourceManager.h"
+#include "XaTransaction.h"
 
 namespace Apache {
 namespace Qpid {
@@ -66,6 +69,9 @@
 	success = true;
 	const ConnectionSettings& settings = connectionp->getNegotiatedSettings();
 	this->maxFrameSize = settings.maxFrameSize;
+	this->host = server;
+	this->port = port;
+	this->isOpen = true;
     } catch (const qpid::Exception& error) {
         String^ errmsg = gcnew String(error.what());
 	openException = gcnew QpidException(errmsg);
@@ -80,6 +86,12 @@
     }
 }
 
+AmqpConnection^ AmqpConnection::Clone() {
+    if (disposed)
+	throw gcnew ObjectDisposedException("AmqpConnection.Clone");
+    return gcnew AmqpConnection (this->host, this->port);
+}
+
 void AmqpConnection::Cleanup()
 {
     {
@@ -91,6 +103,7 @@
 
     try {
         // let the child sessions clean up
+
         for each(AmqpSession^ s in sessions) {
 	    s->ConnectionClosed();
 	}
@@ -98,6 +111,7 @@
     finally
     {
 	if (connectionp != NULL) {
+	    isOpen = false;
 	    connectionp->close();
 	    delete connectionp;
 	    connectionp = NULL;

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.h
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.h?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.h (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.h Fri Dec 18 16:11:39 2009
@@ -28,6 +28,7 @@
 using namespace qpid::client;
 
 ref class AmqpSession;
+ref class DtxResourceManager;
 
 public delegate void ConnectionIdleEventHandler(Object^ sender, EventArgs^ eventArgs);
 
@@ -35,21 +36,44 @@
 {
 private:
     Connection* connectionp;
-    void Cleanup();
+    String^ host;
+    int port;
     bool disposed;
     Collections::Generic::List<AmqpSession^>^ sessions;
     bool isOpen;
     int busyCount;
     int maxFrameSize;
+    DtxResourceManager^ dtxResourceManager;
+    void Cleanup();
+    // unique string used for distributed transactions
+    String^ dataSourceName;
 
  internal:
     void NotifyBusy();
     void NotifyIdle();
+    AmqpConnection^ Clone();
 
     property int MaxFrameSize {
 	int get () { return maxFrameSize; }
     }
 
+    property DtxResourceManager^ CachedResourceManager {
+	DtxResourceManager^ get () { return dtxResourceManager; }
+	void set (DtxResourceManager^ value) { dtxResourceManager = value; }
+    }
+
+    property String^ DataSourceName {
+	// Note: any change to this format has to be reflected in the DTC plugin's xa_open()
+	String^ get() {
+	    if (dataSourceName == nullptr) {
+		dataSourceName = String::Format("{0}.{1}..AMQP.{2}.{3}", port, host, 
+						System::Diagnostics::Process::GetCurrentProcess()->Id, 
+						AppDomain::CurrentDomain->Id);
+	    }
+	    return dataSourceName;
+	}
+    }
+
 public:  
     AmqpConnection(System::String^ server, int port);
     ~AmqpConnection();

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp Fri Dec 18 16:11:39 2009
@@ -19,6 +19,7 @@
 
 #include <windows.h>
 #include <msclr\lock.h>
+#include <oletx2xa.h>
 
 #include "qpid/client/AsyncSession.h"
 #include "qpid/client/SubscriptionManager.h"
@@ -28,6 +29,7 @@
 #include "qpid/client/Message.h"
 #include "qpid/framing/MessageTransferBody.h"
 #include "qpid/client/Future.h"
+#include "qpid/framing/Xid.h"
 
 #include "AmqpConnection.h"
 #include "AmqpSession.h"
@@ -37,6 +39,8 @@
 #include "OutputLink.h"
 #include "QpidMarshal.h"
 #include "QpidException.h"
+#include "XaTransaction.h"
+#include "DtxResourceManager.h"
 
 namespace Apache {
 namespace Qpid {
@@ -44,6 +48,7 @@
 
 using namespace System;
 using namespace System::Runtime::InteropServices;
+using namespace System::Transactions;
 using namespace msclr;
 
 using namespace qpid::client;
@@ -55,15 +60,20 @@
     sessionp(NULL),
     sessionImplp(NULL),
     subs_mgrp(NULL),
-    openCount(0)
+    helperRunning(false),
+    openCount(0),
+    syncCount(0),
+    closing(false),
+    dtxEnabled(false)    
 {
     bool success = false;
-
     try {
 	sessionp = new qpid::client::AsyncSession;
 	*sessionp = qpidConnectionp->newSession();
 	subs_mgrp = new SubscriptionManager (*sessionp);
 	waiters = gcnew Collections::Generic::List<CompletionWaiter^>();
+	sessionLock = waiters;  // waiters convenient and not publicly visible
+	openCloseLock = gcnew Object();
 	success = true;
     } finally {
         if (!success) {
@@ -77,29 +87,36 @@
 
 void AmqpSession::Cleanup()
 {
+    bool connected = connection->IsOpen;
+
     if (subs_mgrp != NULL) {
-	subs_mgrp->stop();
+	if (connected)
+	    subs_mgrp->stop();
 	delete subs_mgrp;
 	subs_mgrp = NULL;
     }
 
-    if (localQueuep != NULL) {
-        delete localQueuep;
-        localQueuep = NULL;
-    }
-
     if (sessionp != NULL) {
-        sessionp->close();
+	if (connected) {
+	    sessionp->close();
+	}
 	delete sessionp;
 	sessionp = NULL;
 	sessionImplp = NULL;
     }
+}
 
-    if (connectionp != NULL) {
-        connectionp->close();
-	delete connectionp;
-	connectionp = NULL;
-    }
+
+static qpid::framing::Xid& getXid(XaTransaction^ xaTx)
+{
+    return *((qpid::framing::Xid *)xaTx->XidHandle.ToPointer());
+}
+
+
+void AmqpSession::CheckOpen()
+{
+    if (closing)
+	throw gcnew ObjectDisposedException("AmqpSession");
 }
 
 
@@ -107,7 +124,41 @@
 
 void AmqpSession::ConnectionClosed()
 {
-    lock l(waiters);
+    lock l(sessionLock);
+
+    if (closing)
+	return;
+
+    closing = true;
+
+    if (connection->IsOpen) {
+	// send closing handshakes...
+
+	if (dtxEnabled) {
+	    // session may close before all its transactions complete, at least force the phase 0 flush
+	    if (pendingTransactions->Count > 0) {
+		array<XaTransaction^>^ txArray = pendingTransactions->ToArray();
+		l.release();
+		for each (XaTransaction^ xaTx in txArray) {
+			//xaTx->SessionClosing(this);
+			xaTx->WaitForCompletion();
+		}
+		l.acquire();
+	    }
+	}
+	    
+	WaitLastSync (%l);
+	// Assert pendingTransactions->Count == 0
+
+	if (openXaTransaction != nullptr) {
+	    // send final dtxend
+	    sessionp->dtxEnd(getXid(openXaTransaction), false, true, false);
+	    openXaTransaction = nullptr;
+	    openSystemTransaction = nullptr;
+	    // this operation will complete by the time Cleanup() returns
+	}
+    }
+
     Cleanup();
 }
 
@@ -119,10 +170,14 @@
 InputLink^ AmqpSession::CreateInputLink(System::String^ sourceQueue, bool exclusive, bool temporary, 
 					System::String^ filterKey, System::String^ exchange)
 {
+    lock ocl(openCloseLock);
+    lock l(sessionLock);
+    CheckOpen();
+
     InputLink^ link = gcnew InputLink (this, sourceQueue, sessionp, subs_mgrp, exclusive, temporary, filterKey, exchange);
     {
-        lock l(waiters);
 	if (openCount == 0) {
+	    l.release();
 	    connection->NotifyBusy();
 	}
 	openCount++;
@@ -132,9 +187,11 @@
 
 OutputLink^ AmqpSession::CreateOutputLink(System::String^ targetQueue)
 {
-    OutputLink^ link = gcnew OutputLink (this, targetQueue);
+    lock ocl(openCloseLock);
+    lock l(sessionLock);
+    CheckOpen();
 
-    lock l(waiters);
+    OutputLink^ link = gcnew OutputLink (this, targetQueue);
 
     if (sessionImplp == NULL) {
 	// not needed unless sending messages
@@ -144,6 +201,7 @@
     }
 
     if (openCount == 0) {
+	l.release();
 	connection->NotifyBusy();
     }
     openCount++;
@@ -155,7 +213,7 @@
 // called whenever a child InputLink or OutputLink is closed or finalized
 void AmqpSession::NotifyClosed()
 {
-    lock l(waiters);
+    lock ocl(openCloseLock);
     openCount--;
     if (openCount == 0) {
 	connection->NotifyIdle();
@@ -165,9 +223,14 @@
 
 CompletionWaiter^ AmqpSession::SendMessage (System::String^ queue, MessageBodyStream ^mbody, TimeSpan timeout, bool async, AsyncCallback^ callback, Object^ state)
 {
-    lock l(waiters);
-    if (sessionp == NULL)
-	throw gcnew ObjectDisposedException("Send");
+    lock l(sessionLock);
+
+    // delimit with session dtx commands depending on the transaction context
+    UpdateTransactionState(%l);
+
+    CheckOpen();
+
+    bool syncPending = false;
 
     // create an AMQP message.transfer command to use with the partial frameset from the MessageBodyStream
 
@@ -191,26 +254,34 @@
 	    // waiter is responsible for releasing the Future native resource
 	    futurep = NULL;
 	    addWaiter(waiter);
-	}
-
-	l.release();
-
-	if (waiter != nullptr)
 	    return waiter;
+	}
 
 	// synchronous send with no timeout: no need to involve the asyncHelper thread
 
+	IncrementSyncs();
+	syncPending = true;
+	l.release();
 	internalWaitForCompletion((IntPtr) futurep);
     }
     finally {
+	if (syncPending) {
+	    if (!l.is_locked())
+		l.acquire();
+	    DecrementSyncs();
+	}
 	if (futurep != NULL)
 	    delete (futurep);
     }
     return nullptr;
 }
     
+
 void AmqpSession::Bind(System::String^ queue, System::String^ exchange, System::String^ filterKey)
 {
+    lock l(sessionLock);
+    CheckOpen();
+
     sessionp->exchangeBind(arg::queue=QpidMarshal::ToNative(queue),
 			       arg::exchange=QpidMarshal::ToNative(exchange),
 			       arg::bindingKey=QpidMarshal::ToNative(filterKey));    
@@ -220,14 +291,8 @@
 
 void AmqpSession::internalWaitForCompletion(IntPtr fp)
 {
-    lock l(waiters);
-    if (sessionp == NULL)
-	throw gcnew ObjectDisposedException("AmqpSession");
+    Debug::Assert(syncCount > 0, "sync counter mismatch");
 
-    // increment the smart pointer count to sessionImplp to guard agains async close
-    Session sessionCopy(*sessionp);
-
-    l.release();
     // Qpid native lib call to wait for the command completion
     ((Future *)fp.ToPointer())->wait(*sessionImplp);
 }
@@ -235,6 +300,7 @@
 // call with lock held
 void AmqpSession::addWaiter(CompletionWaiter^ waiter)
 {
+    IncrementSyncs();
     waiters->Add(waiter);
     if (!helperRunning) {
 	helperRunning = true;
@@ -247,13 +313,14 @@
 {
     // a waiter can be removed from anywhere in the list if timed out
 
-    lock l(waiters);
+    lock l(sessionLock);
     int idx = waiters->IndexOf(waiter);
     if (idx == -1) {
 	// TODO: assert or log
     }
     else {
 	waiters->RemoveAt(idx);
+	DecrementSyncs();
     }
 }
 
@@ -262,7 +329,7 @@
 
 void AmqpSession::asyncHelper(Object ^unused)
 {
-    lock l(waiters);
+    lock l(sessionLock);
 
     while (true) {
 	if (waiters->Count == 0) {
@@ -279,27 +346,267 @@
     }
 }
 
-bool AmqpSession::MessageStop(Completion &comp, std::string &name)
+bool AmqpSession::MessageStop(std::string &name)
 {
-    lock l(waiters);
+    lock l(sessionLock);
 
-    if (sessionp == NULL)
+    if (closing)
 	return false;
 
-    comp = sessionp->messageStop(name, true);
+    sessionp->messageStop(name, true);
     return true;
 }
 
 void AmqpSession::AcceptAndComplete(SequenceSet& transfers)
 {
-    lock l(waiters);
+    lock l(sessionLock);
+
+    // delimit with session dtx commands depending on the transaction context
+    UpdateTransactionState(%l);
 
-    if (sessionp == NULL)
-	throw gcnew ObjectDisposedException("Accept");
+    CheckOpen();
 
     sessionp->markCompleted(transfers, false);
     sessionp->messageAccept(transfers, false);
 }
 
 
+// call with session lock held
+
+void AmqpSession::UpdateTransactionState(lock^ slock)
+{
+    Transaction^ currentTx = Transaction::Current;
+    if ((currentTx == nullptr) && !dtxEnabled) {
+	// no transaction scope and no previous dtx work to monitor
+	return;
+    }
+
+    if (currentTx == openSystemTransaction) {
+	// no change
+	return;
+    }
+
+    if (!dtxEnabled) {
+	// AMQP requires that this be the first dtx-related command on the session
+	sessionp->dtxSelect(false);
+	dtxEnabled = true;
+	pendingTransactions = gcnew Collections::Generic::List<XaTransaction^>();
+    }
+ 
+    bool notify = false; // unless the System.Transaction is no longer active
+    XaTransaction^ oldXaTx = openXaTransaction;
+    if (openSystemTransaction != nullptr) {
+	// The application may start a new transaction before the phase0 on rollback
+	try {
+	    if (openSystemTransaction->TransactionInformation->Status != TransactionStatus::Active) {
+		notify = true;
+	    }
+	} catch (System::ObjectDisposedException^) {
+	    notify = true;
+	}
+    }
+
+    slock->release();
+    // only use stack variables until lock re-acquired
+
+    if (notify) {
+	// will do call back to all enlisted sessions.  call with session lock released.
+	// If NotifyPhase0() wins the race to start phase 0, openXaTransaction will be null
+	oldXaTx->NotifyPhase0();
+    }
+    
+    XaTransaction^ newXaTx = nullptr;
+    if (currentTx != nullptr) {
+	// This must be called with locks released.  The DTC and System.Transactions methods that
+	// will be called hold locks that interfere with the ITransactionResourceAsync callbacks.
+	newXaTx = DtxResourceManager::GetXaTransaction(this, currentTx);
+    }
+
+    slock->acquire();
+
+    if (closing)
+	return;
+
+    if (openSystemTransaction != nullptr) {
+	// some other transaction has the dtx window open
+	// close the XID window, suspend = true... in case it is used again
+	sessionp->dtxEnd(getXid(openXaTransaction), false, true, false);
+	openSystemTransaction = nullptr;
+	openXaTransaction = nullptr;
+    }
+
+
+    // Call enlist with session lock held.  The XaTransaction will call DtxStart before returning.
+    if (newXaTx != nullptr) {
+	if (!pendingTransactions->Contains(newXaTx)) {
+	    pendingTransactions->Add(newXaTx);
+	}
+
+	newXaTx->Enlist(this);
+    }
+
+    openXaTransaction = newXaTx;
+    openSystemTransaction = currentTx;
+}
+
+
+typedef TypedResult<qpid::framing::XaResult> XaResultCompletion;
+
+
+// send the required closing dtx.End before Phase 1
+
+IntPtr AmqpSession::BeginPhase0Flush(XaTransaction ^xaTx) {
+    
+    lock l(sessionLock);
+    IntPtr completionp = IntPtr::Zero;
+    try {
+	if (sessionp != NULL) {
+
+	    // proceed even if "closing == true", the phase 0 is part of the transition from closing to closed
+
+	    if (xaTx != openXaTransaction) {
+		// a different transaction (or none) is in scope, so xaTx was previously suspended.
+		// must re-open it to close it properly
+		if (openXaTransaction != nullptr) {
+		    // suspend the session's current pending transaction
+		    // it wil be reopened in a future enlistment or phase 0 flush.
+		    sessionp->dtxEnd(getXid(openXaTransaction), false, true, false);
+		}
+		// resuming
+		sessionp->dtxStart(getXid(xaTx), false, true, false);
+	    }
+	
+	    // the closing (i.e. non-suspended) dtxEnd happens here (exactly once for a given transaction)
+	    // set the sync bit since phase0 is a precondition to prepare or abort
+	    completionp = (IntPtr) new XaResultCompletion(sessionp->dtxEnd(getXid(xaTx), false, false, true));
+	    IncrementSyncs();
+	}
+    }
+    catch (System::Exception^ ) {
+	// all the caller wants to know is if completionp is non-null
+    }
+
+    openXaTransaction = nullptr;
+    openSystemTransaction = nullptr;
+    return completionp;
+}
+
+
+void AmqpSession::EndPhase0Flush(XaTransaction ^xaTx, IntPtr intptr) {
+    XaResultCompletion *completionp = (XaResultCompletion *) intptr.ToPointer();
+    lock l(sessionLock);
+
+    if (completionp != NULL) {
+	try {
+	    l.release();
+	    completionp->wait();
+	    pendingTransactions->Remove(xaTx);
+	}
+	catch (System::Exception^) {
+	    // connection closed or network drop
+	}
+	finally {
+	    l.acquire();
+	    DecrementSyncs();
+	    delete completionp;
+	}
+    }
+}
+
+
+IntPtr AmqpSession::DtxStart(IntPtr ip, bool join, bool resume) {
+    // called with session lock held (as a callback from the Enlist())
+    // The XaTransaction knows if this should be the originating dtxStart, or a join/resume
+    IntPtr rv = IntPtr::Zero;
+    qpid::framing::Xid* xidp = (qpid::framing::Xid *) ip.ToPointer();
+    if (join || resume) {
+	sessionp->dtxStart(*xidp, join, resume, false);
+    }
+    else {
+	// The XaTransaction needs to track when the first dtxStart completes to safely request a join
+	IncrementSyncs();  // caller must use ReleaseCompletion() for corresponding DecrementSyncs
+	rv = (IntPtr) new XaResultCompletion(sessionp->dtxStart(*xidp, join, resume, false));
+    }
+
+    return rv;
+}
+
+
+IntPtr AmqpSession::DtxPrepare(IntPtr ip) {
+    qpid::framing::Xid* xidp = (qpid::framing::Xid *) ip.ToPointer();
+    lock l(sessionLock);
+
+    if (closing)
+	return IntPtr::Zero;
+
+    IncrementSyncs();  // caller must use ReleaseCompletion() for corresponding DecrementSyncs
+    return (IntPtr) new XaResultCompletion(sessionp->dtxPrepare(*xidp, true));
+}
+
+
+IntPtr AmqpSession::DtxCommit(IntPtr ip, bool onePhase) {
+    qpid::framing::Xid* xidp = (qpid::framing::Xid *) ip.ToPointer();
+    lock l(sessionLock);
+
+    if (closing)
+	return IntPtr::Zero;
+
+    IncrementSyncs();  // caller must use ReleaseCompletion() for corresponding DecrementSyncs
+    return (IntPtr) new XaResultCompletion(sessionp->dtxCommit(*xidp, onePhase, true));
+}
+
+
+IntPtr AmqpSession::DtxRollback(IntPtr ip) {
+    qpid::framing::Xid* xidp = (qpid::framing::Xid *) ip.ToPointer();
+    lock l(sessionLock);
+    if (closing)
+	return IntPtr::Zero;
+
+    IncrementSyncs();  // caller must use ReleaseCompletion() for corresponding DecrementSyncs
+
+    return (IntPtr) new XaResultCompletion(sessionp->dtxRollback(*xidp, true));
+}
+
+
+//call with lock held
+void AmqpSession::IncrementSyncs() {
+    syncCount++;
+}
+
+
+//call with lock held
+void AmqpSession::DecrementSyncs() {
+    syncCount--;
+    Debug::Assert(syncCount >= 0, "sync counter underrun");
+    if (syncCount == 0) {
+	if (closeWaitHandle != nullptr) {
+	    // now OK to move from closing to closed
+	    closeWaitHandle->Set();
+	}
+    }
+}
+
+
+// call with lock held
+void AmqpSession::WaitLastSync(lock ^l) {
+    if (syncCount == 0)
+	return;
+    if (AppDomain::CurrentDomain->IsFinalizingForUnload()) {
+	// a wait would be a hang.  No more syncs coming
+	return;
+    }
+    if (closeWaitHandle == nullptr)
+	closeWaitHandle = gcnew ManualResetEvent(false);
+    l->release();
+    closeWaitHandle->WaitOne();
+    l->acquire();
+}
+
+
+void AmqpSession::ReleaseCompletion(IntPtr completion) {
+    lock l(sessionLock);
+    DecrementSyncs();
+    delete completion.ToPointer();
+}
+
 }}} // namespace Apache::Qpid::Cli

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.h
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.h?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.h (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.h Fri Dec 18 16:11:39 2009
@@ -29,29 +29,50 @@
 
 using namespace System;
 using namespace System::Runtime::InteropServices;
+using namespace System::Transactions;
+using namespace System::Diagnostics;
+
 
 using namespace qpid::client;
 using namespace std;
 
 ref class InputLink;
 ref class OutputLink;
+ref class XaTransaction;
 
 public ref class AmqpSession
 {
 private:
+    Object^ sessionLock;
+    Object^ openCloseLock;
     AmqpConnection^ connection;
-    Connection* connectionp;
     AsyncSession* sessionp;
     SessionImpl* sessionImplp;
     SubscriptionManager* subs_mgrp;
-    LocalQueue* localQueuep;
     Collections::Generic::List<CompletionWaiter^>^ waiters;
     bool helperRunning;
+
+    // number of active InputLinks and OutputLinks
     int openCount;
 
+    // the number of async commands sent to the broker that need completion confirmation
+    int syncCount;
+
+    bool closing;
+    ManualResetEvent^ closeWaitHandle;
+    bool dtxEnabled;
+    Transaction^ openSystemTransaction;
+    XaTransaction^ openXaTransaction;
+    Collections::Generic::List<XaTransaction^>^ pendingTransactions;
+
     void Cleanup();
+    void CheckOpen();
     void asyncHelper(Object ^);
     void addWaiter(CompletionWaiter^ waiter);
+    void UpdateTransactionState(msclr::lock^ sessionLock);
+    void IncrementSyncs();
+    void DecrementSyncs();
+    void WaitLastSync(msclr::lock^ l);
 
 public:  
     OutputLink^ CreateOutputLink(System::String^ targetQueue);
@@ -66,16 +87,21 @@
     void NotifyClosed();
     CompletionWaiter^ SendMessage (System::String^ queue, MessageBodyStream ^mbody, TimeSpan timeout, bool async, AsyncCallback^ callback, Object^ state);
     void ConnectionClosed();
-    void internalWaitForCompletion(IntPtr Future);
+    void internalWaitForCompletion(IntPtr future);
     void removeWaiter(CompletionWaiter^ waiter);
-    bool MessageStop(Completion &comp, std::string &name);
+    bool MessageStop(std::string &name);
     void AcceptAndComplete(SequenceSet& transfers);
+    IntPtr BeginPhase0Flush(XaTransaction^);
+    void EndPhase0Flush(XaTransaction^, IntPtr);
+    IntPtr DtxStart(IntPtr xidp, bool, bool);
+    IntPtr DtxPrepare(IntPtr xidp);
+    IntPtr DtxCommit(IntPtr xidp, bool onePhase);
+    IntPtr DtxRollback(IntPtr xidp);
+    void ReleaseCompletion(IntPtr completion);
 
     property AmqpConnection^ Connection {
 	AmqpConnection^ get () { return connection; }
     }
-
-
 };
 
 }}} // namespace Apache::Qpid::Interop

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/InputLink.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/InputLink.cpp?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/InputLink.cpp (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/InputLink.cpp Fri Dec 18 16:11:39 2009
@@ -86,6 +86,8 @@
     System::Exception^ linkException = nullptr;
 
     waiters = gcnew Collections::Generic::List<MessageWaiter^>();
+    linkLock = waiters;  // private and available
+    subscriptionLock = gcnew Object();
 
     try {
 	std::string qname = QpidMarshal::ToNative(sourceQueue);
@@ -120,10 +122,13 @@
     }
 }
 
+// called with lock held
 void InputLink::ReleaseNative()
 {
     // involves talking to the Broker unless the connection is broken
-    if (subscriptionp != NULL) {
+
+    if ((subscriptionp != NULL) && !finalizing) {
+	// TODO: find boost time error on cleanup when in finalizer thread
         try {
 	    subscriptionp->cancel();
 	}
@@ -134,20 +139,31 @@
     }
 
     // free native mem (or smart pointers) that we own
-    if (subscriptionp != NULL)
+    if (subscriptionp != NULL) {
 	delete subscriptionp;
-    if (queuePtrp != NULL)
+	subscriptionp = NULL;
+    }
+    if (queuePtrp != NULL) {
 	delete queuePtrp;
-    if (localQueuep != NULL)
-	delete localQueuep;
-    if (dequeuedFrameSetpp != NULL)
+	queuePtrp = NULL;
+    }
+    if (localQueuep != NULL) {
+	if (!finalizing) {
+	    // TODO: find boost time error on cleanup when in finalizer thread
+	    delete localQueuep;
+	    localQueuep = NULL;
+	}
+    }
+    if (dequeuedFrameSetpp != NULL) {
 	delete dequeuedFrameSetpp;
+	dequeuedFrameSetpp = NULL;
+    }
 }
 
 void InputLink::Cleanup()
 {
     {
-        lock l(waiters);
+        lock l(linkLock);
         if (disposed)
 	    return;
 
@@ -162,6 +178,9 @@
 	if (queuePtrp != NULL)
 	    (*queuePtrp)->close();
   
+	// wait for any sync operations on the subscription to complete before ReleaseNative
+	lock l2(subscriptionLock);
+
 	try {}
 	finally
 	{
@@ -179,6 +198,7 @@
 
 InputLink::!InputLink()
 {
+    finalizing = true;
     Cleanup();
 }
 
@@ -204,7 +224,7 @@
 	
 IntPtr InputLink::nextLocalMessage()
 {
-    lock l(waiters);
+    lock l(linkLock);
 
     if (disposed)
 	return (IntPtr) NULL;
@@ -250,7 +270,7 @@
 void InputLink::unblockWaiter()
 {
     // to be followed by resetQueue() below
-    lock l(waiters);
+    lock l(linkLock);
     if (disposed)
 	return;
     (*queuePtrp)->close();
@@ -264,7 +284,7 @@
 
 void InputLink::resetQueue()
 {
-    lock l(waiters);
+    lock l(linkLock);
     if (disposed)
 	return;
     if ((*queuePtrp)->isClosed()) {
@@ -282,7 +302,7 @@
     bool received = false;
     QpidFrameSetPtr* frameSetpp = NULL;
     try	{
-	lock l(waiters);
+	lock l(linkLock);
 	if (disposed)
 	    return false;
 	if (haveMessage())
@@ -348,7 +368,7 @@
 void InputLink::removeWaiter(MessageWaiter^ waiter) {
     // a waiter can be removed from anywhere in the list if timed out
 
-    lock l(waiters);
+    lock l(linkLock);
     int idx = waiters->IndexOf(waiter);
     if (idx == -1) {
 	// TODO: assert or log
@@ -388,7 +408,7 @@
 
 void InputLink::asyncHelper()
 {
-    lock l(waiters);
+    lock l(linkLock);
 
     while (true) {
 	if (disposed && (waiters->Count == 0)) {
@@ -419,14 +439,14 @@
 
 void InputLink::sync()
 {
-    // for the timeout thread
-    lock l(waiters);
+    // used by the MessageWaiter timeout thread to not run before fully initialized
+    lock l(linkLock);
 }
 
 
 void InputLink::PrefetchLimit::set(int value)
 {
-    lock l(waiters);
+    lock l(linkLock);
     prefetchLimit = value;
 
     int delta = 0;
@@ -475,31 +495,32 @@
 
 void InputLink::SyncCredit(Object ^unused)
 {
-    lock l(waiters);
+    lock l(linkLock);
 
     try {
 	if (disposed)
 	    return;
 
-	Completion comp;
-	if (!amqpSession->MessageStop(comp, subscriptionp->getName())) {
+	if (!amqpSession->MessageStop(subscriptionp->getName())) {
 	    // connection closed
 	    return;
 	}
 
-	// get a private scoped copy to use outside the lock
-	Subscription s(*subscriptionp);
-
 	l.release();
 	// use setFlowControl to re-enable credit flow on the broker.
-	// previously used comp.wait() here, but setFlowControl is a sync operation
-	s.setFlowControl(s.getSettings().flowControl);
+	// setFlowControl is a sync operation
+	{
+	    lock l2(subscriptionLock);
+	    if (subscriptionp != NULL) {
+		subscriptionp->setFlowControl(subscriptionp->getSettings().flowControl);
+	    }
+	}
 	l.acquire();
 
 	if (disposed)
 	    return;
 
-	// let existing waiters use up any
+	// let existing waiters use up any messages that arrived.
 	// local queue size can only decrease until more credit is issued
 	while (true) {
 	    if ((waiters->Count > 0) && ((*queuePtrp)->size() > 0)) {
@@ -700,7 +721,7 @@
 
 bool InputLink::TryReceive(TimeSpan timeout, [Out] AmqpMessage^% amqpMessage)
 {
-    lock l(waiters);
+    lock l(linkLock);
 
     if (waiters->Count == 0) {
 	// see if there is a message already available without blocking
@@ -740,7 +761,7 @@
 
     //TODO: if haveMessage() complete synchronously
 
-    lock l(waiters);
+    lock l(linkLock);
     MessageWaiter^ waiter = gcnew MessageWaiter(this, timeout, true, true, callback, state);
     addWaiter(waiter);
     return waiter;
@@ -779,7 +800,10 @@
 
 bool InputLink::WaitForMessage(TimeSpan timeout)
 {
-    lock l(waiters);
+    lock l(linkLock);
+
+    if (disposed)
+	return false;
 
     if (waiters->Count == 0) {
 	// see if there is a message already available without blocking
@@ -799,12 +823,12 @@
 	return false;
     }
 
-    return true;
+    return haveMessage();
 }
 
 IAsyncResult^ InputLink::BeginWaitForMessage(TimeSpan timeout, AsyncCallback^ callback, Object^ state)
 {
-    lock l(waiters);
+    lock l(linkLock);
 
     // Same as for BeginTryReceive, except consuming = false
     MessageWaiter^ waiter = gcnew MessageWaiter(this, timeout, false, true, callback, state);
@@ -822,7 +846,7 @@
 	return false;
     }
 
-    return true;
+    return haveMessage();
 }
 
 

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/InputLink.h
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/InputLink.h?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/InputLink.h (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/InputLink.h Fri Dec 18 16:11:39 2009
@@ -45,6 +45,8 @@
     Collections::Generic::List<MessageWaiter^>^ waiters;
     bool disposed;
     bool finalizing;
+    Object^ linkLock;
+    Object^ subscriptionLock;
     QpidFrameSetPtr* dequeuedFrameSetpp;
     ManualResetEvent^ asyncHelperWaitHandle;
     // number of messages to buffer locally for future consumption

Modified: qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/Interop.vcproj
URL: http://svn.apache.org/viewvc/qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/Interop.vcproj?rev=892292&r1=892291&r2=892292&view=diff
==============================================================================
--- qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/Interop.vcproj (original)
+++ qpid/branches/qmfv2/qpid/wcf/src/Apache/Qpid/Interop/Interop.vcproj Fri Dec 18 16:11:39 2009
@@ -32,6 +32,9 @@
 		<Platform
 			Name="Win32"
 		/>
+		<Platform
+			Name="x64"
+		/>
 	</Platforms>
 	<ToolFiles>
 	</ToolFiles>
@@ -63,10 +66,10 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				AdditionalOptions="/FU Debug\Apache.Qpid.AmqpTypes.netmodule"
+				AdditionalOptions=" /Zm1000 /wd4244 /wd4800 /wd4355 /FU $(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
 				Optimization="0"
 				AdditionalIncludeDirectories="&quot;$(QPID_BUILD_ROOT)\include&quot;;&quot;$(QPID_BUILD_ROOT)\src&quot;;..\..\..\..\..\cpp\include;..\..\..\..\..\cpp\src;&quot;$(BOOST_ROOT)&quot;"
-				PreprocessorDefinitions="WIN32;_DEBUG;_CRT_NONSTDC_NO_WARNINGS;WIN32_LEAN_AND_MEAN;NOMINMAX;_SCL_SECURE_NO_WARNINGS;BOOST_ALL_DYN_LINK"
+				PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,BOOST_ALL_DYN_LINK,_CRT_NONSTDC_NO_WARNINGS,NOMINMAX,WIN32_LEAN_AND_MEAN,_SCL_SECURE_NO_WARNINGS,HAVE_CONFIG_H"
 				RuntimeLibrary="3"
 				UsePrecompiledHeader="0"
 				WarningLevel="3"
@@ -83,8 +86,8 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalOptions="$(QPID_BUILD_ROOT)\src\Debug\qpidcommond.lib $(QPID_BUILD_ROOT)\src\Debug\qpidclientd.lib Debug\Apache.Qpid.AmqpTypes.netmodule"
-				AdditionalDependencies="$(NoInherit)"
+				AdditionalOptions=" /STACK:10000000 /machine:I386 $(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
+				AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib xolehlp.lib $(QPID_BUILD_ROOT)\src\Debug\qpidclientd.lib $(QPID_BUILD_ROOT)\src\Debug\qpidcommond.lib rpcrt4.lib ws2_32.lib "
 				OutputFile="$(OutDir)\Apache.Qpid.Interop.dll"
 				LinkIncremental="2"
 				AdditionalLibraryDirectories="&quot;$(BOOST_ROOT)\lib&quot;"
@@ -117,7 +120,7 @@
 		</Configuration>
 		<Configuration
 			Name="Release|Win32"
-			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			OutputDirectory="$(ProjectDir)$(ConfigurationName)"
 			IntermediateDirectory="$(ConfigurationName)"
 			ConfigurationType="2"
 			CharacterSet="1"
@@ -126,6 +129,7 @@
 			>
 			<Tool
 				Name="VCPreBuildEventTool"
+				CommandLine="copy ..\AmqpTypes\obj\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule $(ConfigurationName)"
 			/>
 			<Tool
 				Name="VCCustomBuildTool"
@@ -141,9 +145,12 @@
 			/>
 			<Tool
 				Name="VCCLCompilerTool"
-				PreprocessorDefinitions="WIN32;NDEBUG"
+				AdditionalOptions=" /Zm1000 /wd4244 /wd4800 /wd4355 /FU $(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
+				AdditionalIncludeDirectories="&quot;$(QPID_BUILD_ROOT)\include&quot;;&quot;$(QPID_BUILD_ROOT)\src&quot;;..\..\..\..\..\cpp\include;..\..\..\..\..\cpp\src;&quot;$(BOOST_ROOT)&quot;"
+				PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,BOOST_ALL_DYN_LINK,_CRT_NONSTDC_NO_WARNINGS,NOMINMAX,WIN32_LEAN_AND_MEAN,_SCL_SECURE_NO_WARNINGS,HAVE_CONFIG_H"
+				Optimization="2"
 				RuntimeLibrary="2"
-				UsePrecompiledHeader="2"
+				UsePrecompiledHeader="0"
 				WarningLevel="3"
 				DebugInformationFormat="3"
 			/>
@@ -158,9 +165,12 @@
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="$(NoInherit)"
-				LinkIncremental="1"
-				GenerateDebugInformation="true"
+				AdditionalOptions=" /STACK:10000000 /machine:I386 $(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
+				AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib xolehlp.lib $(QPID_BUILD_ROOT)\src\Release\qpidclient.lib $(QPID_BUILD_ROOT)\src\Release\qpidcommon.lib rpcrt4.lib ws2_32.lib "
+				LinkIncremental="2"
+				OutputFile="$(OutDir)\Apache.Qpid.Interop.dll"
+				AdditionalLibraryDirectories="&quot;$(BOOST_ROOT)\lib&quot;"
+				KeyFile="$(SolutionDir)\src\wcfnet.snk"
 				TargetMachine="1"
 			/>
 			<Tool
@@ -185,6 +195,165 @@
 				Name="VCPostBuildEventTool"
 			/>
 		</Configuration>
+		<Configuration
+			Name="Debug|x64"
+			OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			ManagedExtensions="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine="copy ..\AmqpTypes\obj\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule $(PlatformName)\$(ConfigurationName)"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions=" /Zm1000 /wd4244 /wd4800 /wd4355 /FU $(PlatformName)\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
+				Optimization="0"
+				AdditionalIncludeDirectories="&quot;$(QPID_BUILD_ROOT)\include&quot;;&quot;$(QPID_BUILD_ROOT)\src&quot;;..\..\..\..\..\cpp\include;..\..\..\..\..\cpp\src;&quot;$(BOOST_ROOT)&quot;"
+				PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,BOOST_ALL_DYN_LINK,_CRT_NONSTDC_NO_WARNINGS,NOMINMAX,WIN32_LEAN_AND_MEAN,_SCL_SECURE_NO_WARNINGS,HAVE_CONFIG_H"
+				RuntimeLibrary="3"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions=" /STACK:10000000 /machine:x64 /debug $(PlatformName)\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
+				AdditionalDependencies="$(NoInherit) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib rpcrt4.lib ws2_32.lib xolehlp.lib $(QPID_BUILD_ROOT)\src\Debug\qpidcommond.lib $(QPID_BUILD_ROOT)\src\Debug\qpidclientd.lib"
+				OutputFile="$(OutDir)\Apache.Qpid.Interop.dll"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories="&quot;$(BOOST_ROOT)\lib&quot;"
+				GenerateDebugInformation="true"
+				AssemblyDebug="1"
+				TargetMachine="17"
+				KeyFile="$(SolutionDir)\src\wcfnet.snk"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|x64"
+			OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
+			IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
+			ConfigurationType="2"
+			CharacterSet="1"
+			ManagedExtensions="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+				CommandLine="copy ..\AmqpTypes\obj\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule $(PlatformName)\$(ConfigurationName)"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+				TargetEnvironment="3"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalOptions=" /Zm1000 /wd4244 /wd4800 /wd4355 /FU $(PlatformName)\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
+				AdditionalIncludeDirectories="&quot;$(QPID_BUILD_ROOT)\include&quot;;&quot;$(QPID_BUILD_ROOT)\src&quot;;..\..\..\..\..\cpp\include;..\..\..\..\..\cpp\src;&quot;$(BOOST_ROOT)&quot;"
+				PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,BOOST_ALL_DYN_LINK,_CRT_NONSTDC_NO_WARNINGS,NOMINMAX,WIN32_LEAN_AND_MEAN,_SCL_SECURE_NO_WARNINGS,HAVE_CONFIG_H"
+				InlineFunctionExpansion="2"
+				Optimization="2"
+				RuntimeLibrary="2"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalOptions=" /STACK:10000000 /machine:x64 $(PlatformName)\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
+				AdditionalDependencies="$(NoInherit) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib xolehlp.lib $(QPID_BUILD_ROOT)\src\Release\qpidclient.lib $(QPID_BUILD_ROOT)\src\Release\qpidcommon.lib rpcrt4.lib ws2_32.lib"
+				LinkIncremental="2"
+				OutputFile="$(OutDir)\Apache.Qpid.Interop.dll"
+				AdditionalLibraryDirectories="&quot;$(BOOST_ROOT)\lib&quot;"
+				KeyFile="$(SolutionDir)\src\wcfnet.snk"
+				TargetMachine="17"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
 	</Configurations>
 	<References>
 		<AssemblyReference
@@ -207,6 +376,11 @@
 			AssemblyName="System.Runtime.Serialization, Version=3.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
 			MinFrameworkVersion="196608"
 		/>
+		<AssemblyReference
+			RelativePath="System.Transactions.dll"
+			AssemblyName="System.Transactions, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
+			MinFrameworkVersion="131072"
+		/>
 	</References>
 	<Files>
 		<Filter
@@ -250,6 +424,14 @@
 				RelativePath=".\OutputLink.cpp"
 				>
 			</File>
+			<File
+				RelativePath=".\DtxResourceManager.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\XaTransaction.cpp"
+				>
+			</File>
 		</Filter>
 		<Filter
 			Name="Header Files"
@@ -296,6 +478,14 @@
 				RelativePath=".\QpidMarshal.h"
 				>
 			</File>
+			<File
+				RelativePath=".\DtxResourceManager.h"
+				>
+			</File>
+			<File
+				RelativePath=".\XaTransaction.h"
+				>
+			</File>
 		</Filter>
 	</Files>
 	<Globals>



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