activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgo...@apache.org
Subject svn commit: r1144423 [1/2] - in /activemq/activemq-dotnet/Apache.NMS.ZMQ: ./ branches/ tags/ trunk/ trunk/src/ trunk/src/main/ trunk/src/main/csharp/ trunk/src/main/ndoc/ trunk/src/main/sandcastle/ trunk/src/test/ trunk/src/test/csharp/
Date Fri, 08 Jul 2011 18:55:18 GMT
Author: jgomes
Date: Fri Jul  8 18:55:17 2011
New Revision: 1144423

URL: http://svn.apache.org/viewvc?rev=1144423&view=rev
Log:
Initial check-in.  Base implementation contributed by Luis Gomez.  Thanks, Luis!  Additional work done by Jim Gomes.
Fixes [AMQNET-333]. (See https://issues.apache.org/jira/browse/AMQNET-333)

Added:
    activemq/activemq-dotnet/Apache.NMS.ZMQ/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/branches/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/tags/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/LICENSE.txt
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/NOTICE.txt
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/README.txt
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/BaseMessage.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/BytesMessage.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/CommonAssemblyInfo.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Connection.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ConnectionFactory.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ConnectionMetaData.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/DefaultMessageConverter.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Destination.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/IMessageConverter.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MapMessage.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageProducer.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ObjectMessage.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Queue.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Session.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/StreamMessage.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/TemporaryQueue.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/TemporaryTopic.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/TextMessage.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Topic.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ZmqMessage.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ZmqSubscriber.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/ndoc/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/ndoc/NamespaceSummary.xml
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/sandcastle/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/sandcastle/feedback_content.xml
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/test/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/test/csharp/   (with props)
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/test/csharp/CommonAssemblyInfo.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/test/csharp/ZMQTest.cs
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/vs2010-zmq-net-4.0-test.csproj
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/vs2010-zmq-net-4.0.csproj
    activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/vs2010-zmq.sln

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/
------------------------------------------------------------------------------
    bugtraq:label = Issue#:

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/
------------------------------------------------------------------------------
--- bugtraq:message (added)
+++ bugtraq:message Fri Jul  8 18:55:17 2011
@@ -0,0 +1 @@
+Fixes [AMQNET-%BUGID%]. (See https://issues.apache.org/jira/browse/AMQNET-%BUGID%)

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/
------------------------------------------------------------------------------
    bugtraq:url = https://issues.apache.org/jira/browse/AMQNET-%BUGID%

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/branches/
------------------------------------------------------------------------------
    bugtraq:label = Issue#:

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/branches/
------------------------------------------------------------------------------
--- bugtraq:message (added)
+++ bugtraq:message Fri Jul  8 18:55:17 2011
@@ -0,0 +1 @@
+Fixes [AMQNET-%BUGID%]. (See https://issues.apache.org/jira/browse/AMQNET-%BUGID%)

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/branches/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/branches/
------------------------------------------------------------------------------
    bugtraq:url = https://issues.apache.org/jira/browse/AMQNET-%BUGID%

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/tags/
------------------------------------------------------------------------------
    bugtraq:label = Issue#:

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/tags/
------------------------------------------------------------------------------
--- bugtraq:message (added)
+++ bugtraq:message Fri Jul  8 18:55:17 2011
@@ -0,0 +1 @@
+Fixes [AMQNET-%BUGID%]. (See https://issues.apache.org/jira/browse/AMQNET-%BUGID%)

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/tags/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/tags/
------------------------------------------------------------------------------
    bugtraq:url = https://issues.apache.org/jira/browse/AMQNET-%BUGID%

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/
------------------------------------------------------------------------------
    bugtraq:label = Issue#:

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/
------------------------------------------------------------------------------
--- bugtraq:message (added)
+++ bugtraq:message Fri Jul  8 18:55:17 2011
@@ -0,0 +1 @@
+Fixes [AMQNET-%BUGID%]. (See https://issues.apache.org/jira/browse/AMQNET-%BUGID%)

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/
------------------------------------------------------------------------------
    bugtraq:url = https://issues.apache.org/jira/browse/AMQNET-%BUGID%

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jul  8 18:55:17 2011
@@ -0,0 +1,3 @@
+bin
+lib
+obj

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/LICENSE.txt
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/LICENSE.txt?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/LICENSE.txt (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/LICENSE.txt Fri Jul  8 18:55:17 2011
@@ -0,0 +1,210 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+APACHE NMS ZEROMQ PROVIDER DEPENDENCIES:
+
+The Apache NMS ZeroMQ message broker provider includes a number of dependencies, many 
+of them optional, with separate copyright notices and license terms. Your 
+use of the source code for the these subcomponents is subject to the terms 
+and conditions of the following licenses. 
+

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/NOTICE.txt
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/NOTICE.txt?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/NOTICE.txt (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/NOTICE.txt Fri Jul  8 18:55:17 2011
@@ -0,0 +1,12 @@
+=========================================================================
+==  NOTICE file corresponding to the section 4 d of                    ==
+==  the Apache License, Version 2.0,                                   ==
+==  in this case for the Apache ActiveMQ distribution.                 ==
+=========================================================================
+
+Apache ActiveMQ
+Copyright 2005-2006 The Apache Software Foundation
+
+This product includes software developed by
+The Apache Software Foundation (http://www.apache.org/).
+

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/README.txt
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/README.txt?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/README.txt (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/README.txt Fri Jul  8 18:55:17 2011
@@ -0,0 +1,58 @@
+=======================================================================
+Welcome to:
+ * Apache.NMS.ZMQ : Apache NMS(tm) for ZeroMQ Client Library
+=======================================================================
+
+For more information see http://activemq.apache.org/nms
+
+=======================================================================
+Building With NAnt 0.86 see http://nant.sourceforge.net/
+=======================================================================
+
+NAnt version 0.86 or newer is required to build Apache.NMS.ZMQ.  Version 0.90
+or newer is highly recommended.
+To build the code using NAnt, run:
+
+  nant
+
+To run the unit tests you need to run an Apache ActiveMQ Broker first then run:
+
+  nant test
+
+The NMS documentation can be generated into three different formats using
+Microsoft's Sandcastle open source product. The Sandcastle Styles project
+was used to enhance the output generated from the current release of Sandcastle.
+
+The Sandcastle project is located here:
+
+http://sandcastle.codeplex.com/
+
+The Sandcastle Styles project is located here:
+
+http://sandcastlestyles.codeplex.com/
+
+To generate the documentation, run:
+
+  nant sandcastle-all
+
+=======================================================================
+Building With Visual Studio 2010
+=======================================================================
+
+First build the project with nant, this will download and install 
+all the 3rd party dependencies for you.
+
+Open the solution File.  Build using "Build"->"Build Solution" 
+menu option.
+
+The resulting DLLs will be in build\${framework}\debug or the 
+build\${framework}\release directories depending on your settings 
+under "Build"->"Configuration Manager"
+
+If you have the Resharper plugin installed in Visual Studio, you can run 
+all the Unit Tests by using the "ReSharper"->"Unit Testing"->"Run All 
+Tests from Solution" menu option.  Please note that you must run an 
+Apache ActiveMQ Broker before kicking off the unit tests.  Otherwise,
+the standalone NUnit test runner can be used.  NUnit version 2.5.8
+is required to build and run the unit tests.
+

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/
------------------------------------------------------------------------------
    bugtraq:label = Issue#:

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/
------------------------------------------------------------------------------
--- bugtraq:message (added)
+++ bugtraq:message Fri Jul  8 18:55:17 2011
@@ -0,0 +1 @@
+Fixes [AMQNET-%BUGID%]. (See https://issues.apache.org/jira/browse/AMQNET-%BUGID%)

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/
------------------------------------------------------------------------------
    bugtraq:url = https://issues.apache.org/jira/browse/AMQNET-%BUGID%

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/
------------------------------------------------------------------------------
    bugtraq:label = Issue#:

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/
------------------------------------------------------------------------------
--- bugtraq:message (added)
+++ bugtraq:message Fri Jul  8 18:55:17 2011
@@ -0,0 +1 @@
+Fixes [AMQNET-%BUGID%]. (See https://issues.apache.org/jira/browse/AMQNET-%BUGID%)

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/
------------------------------------------------------------------------------
    bugtraq:url = https://issues.apache.org/jira/browse/AMQNET-%BUGID%

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/
------------------------------------------------------------------------------
    bugtraq:label = Issue#:

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/
------------------------------------------------------------------------------
--- bugtraq:message (added)
+++ bugtraq:message Fri Jul  8 18:55:17 2011
@@ -0,0 +1 @@
+Fixes [AMQNET-%BUGID%]. (See https://issues.apache.org/jira/browse/AMQNET-%BUGID%)

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/
------------------------------------------------------------------------------
    bugtraq:number = true

Propchange: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/
------------------------------------------------------------------------------
    bugtraq:url = https://issues.apache.org/jira/browse/AMQNET-%BUGID%

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/BaseMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/BaseMessage.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/BaseMessage.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/BaseMessage.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,215 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using Apache.NMS.Util;
+
+namespace Apache.NMS.ZMQ
+{
+	public delegate void AcknowledgeHandler(BaseMessage baseMessage);
+
+	public class BaseMessage : IMessage
+	{
+		private PrimitiveMap propertiesMap = new PrimitiveMap();
+		private IDestination destination;
+		private string correlationId;
+		private TimeSpan timeToLive;
+		private string messageId;
+		private MsgDeliveryMode deliveryMode;
+		private MsgPriority priority;
+		private Destination replyTo;
+		private byte[] content;
+		private string type;
+		private event AcknowledgeHandler Acknowledger;
+		private DateTime timestamp = new DateTime();
+		private bool readOnlyMsgBody = false;
+
+		public bool ReadOnlyBody
+		{
+			get { return readOnlyMsgBody; }
+			set { readOnlyMsgBody = value; }
+		}
+
+		// IMessage interface
+
+		public void Acknowledge()
+		{
+			if(null != Acknowledger)
+			{
+				Acknowledger(this);
+			}
+		}
+
+		/// <summary>
+		/// Clears out the message body. Clearing a message's body does not clear its header
+		/// values or property entries.
+		///
+		/// If this message body was read-only, calling this method leaves the message body in
+		/// the same state as an empty body in a newly created message.
+		/// </summary>
+		public virtual void ClearBody()
+		{
+			this.Content = null;
+			this.readOnlyMsgBody = false;
+		}
+
+		/// <summary>
+		/// Clears a message's properties.
+		///
+		/// The message's header fields and body are not cleared.
+		/// </summary>
+		public virtual void ClearProperties()
+		{
+			propertiesMap.Clear();
+		}
+
+		// Properties
+
+		public IPrimitiveMap Properties
+		{
+			get { return propertiesMap; }
+		}
+
+
+		// NMS headers
+
+		/// <summary>
+		/// The correlation ID used to correlate messages with conversations or long running business processes
+		/// </summary>
+		public string NMSCorrelationID
+		{
+			get { return correlationId; }
+			set { correlationId = value; }
+		}
+
+		/// <summary>
+		/// The destination of the message
+		/// </summary>
+		public IDestination NMSDestination
+		{
+			get { return destination; }
+			set { destination = value; }
+		}
+
+		/// <summary>
+		/// The time in milliseconds that this message should expire in
+		/// </summary>
+		public TimeSpan NMSTimeToLive
+		{
+			get { return timeToLive; }
+			set { timeToLive = value; }
+		}
+
+		/// <summary>
+		/// The message ID which is set by the provider
+		/// </summary>
+		public string NMSMessageId
+		{
+			get { return messageId; }
+			set { messageId = value; }
+		}
+
+		/// <summary>
+		/// Whether or not this message is persistent
+		/// </summary>
+		public MsgDeliveryMode NMSDeliveryMode
+		{
+			get { return deliveryMode; }
+			set { deliveryMode = value; }
+		}
+
+		/// <summary>
+		/// The Priority on this message
+		/// </summary>
+		public MsgPriority NMSPriority
+		{
+			get { return priority; }
+			set { priority = value; }
+		}
+
+		/// <summary>
+		/// Returns true if this message has been redelivered to this or another consumer before being acknowledged successfully.
+		/// </summary>
+		public bool NMSRedelivered
+		{
+			get { return false; }
+			set { }
+		}
+
+
+		/// <summary>
+		/// The destination that the consumer of this message should send replies to
+		/// </summary>
+		public IDestination NMSReplyTo
+		{
+			get { return replyTo; }
+			set { replyTo = (Destination) value; }
+		}
+
+
+		/// <summary>
+		/// The timestamp the broker added to the message
+		/// </summary>
+		public DateTime NMSTimestamp
+		{
+			get { return timestamp; }
+			set { timestamp = value; }
+		}
+
+		public byte[] Content
+		{
+			get { return content; }
+			set { this.content = value; }
+		}
+
+		/// <summary>
+		/// The type name of this message
+		/// </summary>
+		public string NMSType
+		{
+			get { return type; }
+			set { type = value; }
+		}
+
+
+		public object GetObjectProperty(string name)
+		{
+			return null;
+		}
+
+		public void SetObjectProperty(string name, object value)
+		{
+		}
+
+		protected void FailIfReadOnlyBody()
+		{
+			if(ReadOnlyBody == true)
+			{
+				throw new MessageNotWriteableException("Message is in Read-Only mode.");
+			}
+		}
+
+		protected void FailIfWriteOnlyBody()
+		{
+			if(ReadOnlyBody == false)
+			{
+				throw new MessageNotReadableException("Message is in Write-Only mode.");
+			}
+		}
+	}
+}
+

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/BytesMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/BytesMessage.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/BytesMessage.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/BytesMessage.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,512 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+using System;
+using System.IO;
+using Apache.NMS.Util;
+
+namespace Apache.NMS.ZMQ
+{
+	/// <summary>
+	///
+	/// A BytesMessage object is used to send a message containing a stream of uninterpreted
+	/// bytes. It inherits from the Message interface and adds a bytes message body. The
+	/// receiver of the message supplies the interpretation of the bytes.
+	///
+	/// This message type is for client encoding of existing message formats. If possible,
+	/// one of the other self-defining message types should be used instead.
+	///
+	/// Although the NMS API allows the use of message properties with byte messages, they
+	/// are typically not used, since the inclusion of properties may affect the format.
+	///
+	/// When the message is first created, and when ClearBody is called, the body of the
+	/// message is in write-only mode. After the first call to Reset has been made, the
+	/// message body is in read-only mode. After a message has been sent, the client that
+	/// sent it can retain and modify it without affecting the message that has been sent.
+	/// The same message object can be sent multiple times. When a message has been received,
+	/// the provider has called Reset so that the message body is in read-only mode for the
+	/// client.
+	///
+	/// If ClearBody is called on a message in read-only mode, the message body is cleared and
+	/// the message is in write-only mode.
+	///
+	/// If a client attempts to read a message in write-only mode, a MessageNotReadableException
+	/// is thrown.
+	///
+	/// If a client attempts to write a message in read-only mode, a MessageNotWriteableException
+	/// is thrown.
+	/// </summary>
+	public class BytesMessage : BaseMessage, IBytesMessage
+	{
+		private EndianBinaryReader dataIn = null;
+		private EndianBinaryWriter dataOut = null;
+		private MemoryStream outputBuffer = null;
+
+		// Need this later when we add compression to store true content length.
+		private long length = 0;
+
+		public override void ClearBody()
+		{
+			base.ClearBody();
+			this.outputBuffer = null;
+			this.dataIn = null;
+			this.dataOut = null;
+			this.length = 0;
+		}
+
+		public long BodyLength
+		{
+			get
+			{
+				InitializeReading();
+				return this.length;
+			}
+		}
+
+		public byte ReadByte()
+		{
+			InitializeReading();
+			try
+			{
+				return dataIn.ReadByte();
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public void WriteByte(byte value)
+		{
+			InitializeWriting();
+			try
+			{
+				dataOut.Write(value);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public bool ReadBoolean()
+		{
+			InitializeReading();
+			try
+			{
+				return dataIn.ReadBoolean();
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public void WriteBoolean(bool value)
+		{
+			InitializeWriting();
+			try
+			{
+				dataOut.Write(value);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public char ReadChar()
+		{
+			InitializeReading();
+			try
+			{
+				return dataIn.ReadChar();
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public void WriteChar(char value)
+		{
+			InitializeWriting();
+			try
+			{
+				dataOut.Write(value);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public short ReadInt16()
+		{
+			InitializeReading();
+			try
+			{
+				return dataIn.ReadInt16();
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public void WriteInt16(short value)
+		{
+			InitializeWriting();
+			try
+			{
+				dataOut.Write(value);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public int ReadInt32()
+		{
+			InitializeReading();
+			try
+			{
+				return dataIn.ReadInt32();
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public void WriteInt32(int value)
+		{
+			InitializeWriting();
+			try
+			{
+				dataOut.Write(value);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public long ReadInt64()
+		{
+			InitializeReading();
+			try
+			{
+				return dataIn.ReadInt64();
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public void WriteInt64(long value)
+		{
+			InitializeWriting();
+			try
+			{
+				dataOut.Write(value);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public float ReadSingle()
+		{
+			InitializeReading();
+			try
+			{
+				return dataIn.ReadSingle();
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public void WriteSingle(float value)
+		{
+			InitializeWriting();
+			try
+			{
+				dataOut.Write(value);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public double ReadDouble()
+		{
+			InitializeReading();
+			try
+			{
+				return dataIn.ReadDouble();
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public void WriteDouble(double value)
+		{
+			InitializeWriting();
+			try
+			{
+				dataOut.Write(value);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public int ReadBytes(byte[] value)
+		{
+			InitializeReading();
+			try
+			{
+				return dataIn.Read(value, 0, value.Length);
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public int ReadBytes(byte[] value, int length)
+		{
+			InitializeReading();
+			try
+			{
+				return dataIn.Read(value, 0, length);
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public void WriteBytes(byte[] value)
+		{
+			InitializeWriting();
+			try
+			{
+				dataOut.Write(value, 0, value.Length);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public void WriteBytes(byte[] value, int offset, int length)
+		{
+			InitializeWriting();
+			try
+			{
+				dataOut.Write(value, offset, length);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public string ReadString()
+		{
+			InitializeReading();
+			try
+			{
+				// JMS, CMS and NMS all encode the String using a 16 bit size header.
+				return dataIn.ReadString16();
+			}
+			catch(EndOfStreamException e)
+			{
+				throw NMSExceptionSupport.CreateMessageEOFException(e);
+			}
+			catch(IOException e)
+			{
+				throw NMSExceptionSupport.CreateMessageFormatException(e);
+			}
+		}
+
+		public void WriteString(string value)
+		{
+			InitializeWriting();
+			try
+			{
+				// JMS, CMS and NMS all encode the String using a 16 bit size header.
+				dataOut.WriteString16(value);
+			}
+			catch(Exception e)
+			{
+				throw NMSExceptionSupport.Create(e);
+			}
+		}
+
+		public void WriteObject(System.Object value)
+		{
+			InitializeWriting();
+			if(value is System.Byte)
+			{
+				this.dataOut.Write((byte) value);
+			}
+			else if(value is Char)
+			{
+				this.dataOut.Write((char) value);
+			}
+			else if(value is Boolean)
+			{
+				this.dataOut.Write((bool) value);
+			}
+			else if(value is Int16)
+			{
+				this.dataOut.Write((short) value);
+			}
+			else if(value is Int32)
+			{
+				this.dataOut.Write((int) value);
+			}
+			else if(value is Int64)
+			{
+				this.dataOut.Write((long) value);
+			}
+			else if(value is Single)
+			{
+				this.dataOut.Write((float) value);
+			}
+			else if(value is Double)
+			{
+				this.dataOut.Write((double) value);
+			}
+			else if(value is byte[])
+			{
+				this.dataOut.Write((byte[]) value);
+			}
+			else if(value is String)
+			{
+				this.dataOut.WriteString16((string) value);
+			}
+			else
+			{
+				throw new MessageFormatException("Cannot write non-primitive type:" + value.GetType());
+			}
+		}
+
+		public void Reset()
+		{
+			StoreContent();
+			this.dataIn = null;
+			this.dataOut = null;
+			this.outputBuffer = null;
+			this.ReadOnlyBody = true;
+		}
+
+		private void InitializeReading()
+		{
+			FailIfWriteOnlyBody();
+			if(this.dataIn == null)
+			{
+				if(this.Content != null)
+				{
+					this.length = this.Content.Length;
+				}
+
+				// TODO - Add support for Message Compression.
+				MemoryStream bytesIn = new MemoryStream(this.Content, false);
+				dataIn = new EndianBinaryReader(bytesIn);
+			}
+		}
+
+		private void InitializeWriting()
+		{
+			FailIfReadOnlyBody();
+			if(this.dataOut == null)
+			{
+				// TODO - Add support for Message Compression.
+				this.outputBuffer = new MemoryStream();
+				this.dataOut = new EndianBinaryWriter(outputBuffer);
+			}
+		}
+
+		private void StoreContent()
+		{
+			if(dataOut != null)
+			{
+				dataOut.Close();
+				// TODO - Add support for Message Compression.
+
+				this.Content = outputBuffer.ToArray();
+				this.dataOut = null;
+				this.outputBuffer = null;
+			}
+		}
+	}
+}
+

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/CommonAssemblyInfo.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/CommonAssemblyInfo.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/CommonAssemblyInfo.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/CommonAssemblyInfo.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,28 @@
+using System;
+using System.Reflection;
+using System.Runtime.InteropServices;
+
+//------------------------------------------------------------------------------
+// <auto-generated>
+//     This code was generated by a tool.
+//     Runtime Version:2.0.50727.4952
+//
+//     Changes to this file may cause incorrect behavior and will be lost if
+//     the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+[assembly: ComVisibleAttribute(false)]
+[assembly: CLSCompliantAttribute(true)]
+[assembly: AssemblyTitleAttribute("Apache NMS for ZMQ Class Library")]
+[assembly: AssemblyDescriptionAttribute("Apache NMS for ZMQ Class Library (.Net Messaging Library Implementation): An imp" +
+    "lementation of the NMS API for ZMQ")]
+[assembly: AssemblyConfigurationAttribute("SNAPSHOT")]
+[assembly: AssemblyCompanyAttribute("http://activemq.apache.org/nms")]
+[assembly: AssemblyProductAttribute("Apache NMS for ZMQ Class Library")]
+[assembly: AssemblyCopyrightAttribute("Copyright (C) 2005-2011 Apache Software Foundation")]
+[assembly: AssemblyTrademarkAttribute("")]
+[assembly: AssemblyCultureAttribute("")]
+[assembly: AssemblyVersionAttribute("1.0.0.1")]
+[assembly: AssemblyInformationalVersionAttribute("1.0.0")]
+

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Connection.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Connection.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Connection.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Connection.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,249 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using CLRZMQ = ZMQ;
+
+namespace Apache.NMS.ZMQ
+{
+	/// <summary>
+	/// Represents a NMS connection ZMQ.  
+	/// </summary>
+	///
+	public class Connection : IConnection
+	{
+		private AcknowledgementMode acknowledgementMode = AcknowledgementMode.AutoAcknowledge;
+		private IMessageConverter messageConverter = new DefaultMessageConverter();
+
+		private IRedeliveryPolicy redeliveryPolicy;
+		private ConnectionMetaData metaData = null;
+		private bool closed = true;
+		private string clientId;
+		private Uri brokerUri;
+
+		/// <summary>
+		/// ZMQ context 
+		/// </summary>
+		static private CLRZMQ.Context _context = new CLRZMQ.Context(1);
+
+		/// <summary>
+		/// Starts message delivery for this connection.
+		/// </summary>
+		public void Start()
+		{
+			CheckConnected();
+		}
+
+		/// <summary>
+		/// This property determines if the asynchronous message delivery of incoming
+		/// messages has been started for this connection.
+		/// </summary>
+		public bool IsStarted
+		{
+			get { return true; }
+		}
+
+		/// <summary>
+		/// Stop message delivery for this connection.
+		/// </summary>
+		public void Stop()
+		{
+			CheckConnected();
+		}
+
+		/// <summary>
+		/// Creates a new session to work on this connection
+		/// </summary>
+		public ISession CreateSession()
+		{
+			return CreateSession(acknowledgementMode);
+		}
+
+		/// <summary>
+		/// Creates a new session to work on this connection
+		/// </summary>
+		public ISession CreateSession(AcknowledgementMode mode)
+		{
+			CheckConnected();
+			return new Session(this, mode);
+		}
+
+		public void Dispose()
+		{
+			closed = true;
+		}
+
+		/// <summary>
+		/// The default timeout for network requests.
+		/// </summary>
+		public TimeSpan RequestTimeout
+		{
+			get { return NMSConstants.defaultRequestTimeout; }
+			set { }
+		}
+
+		public AcknowledgementMode AcknowledgementMode
+		{
+			get { return acknowledgementMode; }
+			set { acknowledgementMode = value; }
+		}
+
+		public IMessageConverter MessageConverter
+		{
+			get { return messageConverter; }
+			set { messageConverter = value; }
+		}
+
+		/// <summary>
+		/// Get/or set the broker Uri.
+		/// </summary>
+		public Uri BrokerUri
+		{
+			get { return brokerUri; }
+			set { brokerUri = value; }
+		}
+
+		/// <summary>
+		/// Get/or set the client Id
+		/// </summary>
+		public string ClientId
+		{
+			get { return clientId; }
+			set
+			{
+				clientId = value;
+			}
+		}
+
+		/// <summary>
+		/// Get/or set the redelivery policy for this connection.
+		/// </summary>
+		public IRedeliveryPolicy RedeliveryPolicy
+		{
+			get { return this.redeliveryPolicy; }
+			set { this.redeliveryPolicy = value; }
+		}
+
+		private ConsumerTransformerDelegate consumerTransformer;
+		public ConsumerTransformerDelegate ConsumerTransformer
+		{
+			get { return this.consumerTransformer; }
+			set { this.consumerTransformer = value; }
+		}
+
+		private ProducerTransformerDelegate producerTransformer;
+		public ProducerTransformerDelegate ProducerTransformer
+		{
+			get { return this.producerTransformer; }
+			set { this.producerTransformer = value; }
+		}
+
+		/// <summary>
+		/// Gets ZMQ connection context
+		/// </summary>
+		static internal CLRZMQ.Context Context
+		{
+			get
+			{
+				return _context;
+			}
+		}
+
+		/// <summary>
+		/// Gets the Meta Data for the NMS Connection instance.
+		/// </summary>
+		public IConnectionMetaData MetaData
+		{
+			get { return this.metaData ?? (this.metaData = new ConnectionMetaData()); }
+		}
+
+		/// <summary>
+		/// A delegate that can receive transport level exceptions.
+		/// </summary>
+		public event ExceptionListener ExceptionListener;
+
+		/// <summary>
+		/// An asynchronous listener that is notified when a Fault tolerant connection
+		/// has been interrupted.
+		/// </summary>
+		public event ConnectionInterruptedListener ConnectionInterruptedListener;
+
+		/// <summary>
+		/// An asynchronous listener that is notified when a Fault tolerant connection
+		/// has been resumed.
+		/// </summary>
+		public event ConnectionResumedListener ConnectionResumedListener;
+
+		protected void CheckConnected()
+		{
+			closed = false;
+			if(null == messageConverter)
+			{
+				throw new NMSException("Context Not Created");
+			}
+		}
+
+		public void Close()
+		{
+			Dispose();
+		}
+
+		public void HandleException(System.Exception e)
+		{
+			if(ExceptionListener != null && !this.closed)
+			{
+				ExceptionListener(e);
+			}
+			else
+			{
+				Tracer.Error(e);
+			}
+		}
+
+		public void HandleTransportInterrupted()
+		{
+			Tracer.Debug("Transport has been Interrupted.");
+
+			if(this.ConnectionInterruptedListener != null && !this.closed)
+			{
+				try
+				{
+					this.ConnectionInterruptedListener();
+				}
+				catch
+				{
+				}
+			}
+		}
+
+		public void HandleTransportResumed()
+		{
+			Tracer.Debug("Transport has resumed normal operation.");
+
+			if(this.ConnectionResumedListener != null && !this.closed)
+			{
+				try
+				{
+					this.ConnectionResumedListener();
+				}
+				catch
+				{
+				}
+			}
+		}
+	}
+}

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ConnectionFactory.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ConnectionFactory.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ConnectionFactory.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ConnectionFactory.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+using Apache.NMS.Policies;
+
+namespace Apache.NMS.ZMQ
+{
+	/// <summary>
+	/// A Factory that can estbalish NMS connections to ZMQ subscriber
+	/// </summary>
+	public class ConnectionFactory : IConnectionFactory
+	{
+		public const string DEFAULT_BROKER_URL = "zmq://localhost";
+		public const string ENV_BROKER_URL = "ZMQ_BROKER_URL";
+		private Uri brokerUri;
+		private IRedeliveryPolicy redeliveryPolicy = new RedeliveryPolicy();
+		private string clientID;
+
+		public static string GetDefaultBrokerUrl()
+		{
+			string answer = Environment.GetEnvironmentVariable(ENV_BROKER_URL);
+			if(answer == null)
+			{
+				answer = DEFAULT_BROKER_URL;
+			}
+			return answer;
+		}
+
+		public ConnectionFactory()
+			: this(GetDefaultBrokerUrl())
+		{
+		}
+
+		public ConnectionFactory(string brokerUri)
+			: this(brokerUri, null)
+		{
+		}
+
+		public ConnectionFactory(string brokerUri, string clientID)
+			: this(new Uri(brokerUri), clientID)
+		{
+		}
+
+		public ConnectionFactory(Uri brokerUri)
+			: this(brokerUri, null)
+		{
+		}
+
+		public ConnectionFactory(Uri brokerUri, string clientID)
+		{
+			this.brokerUri = brokerUri;
+			this.clientID = clientID;
+		}
+
+		/// <summary>
+		/// Creates a new connection to ZMQ.
+		/// </summary>
+		public IConnection CreateConnection()
+		{
+			return CreateConnection(string.Empty, string.Empty, false);
+		}
+
+		/// <summary>
+		/// Creates a new connection to ZMQ.
+		/// </summary>
+		public IConnection CreateConnection(string userName, string password)
+		{
+			return CreateConnection(userName, password, false);
+		}
+
+		/// <summary>
+		/// Creates a new connection to ZMQ.
+		/// </summary>
+		public IConnection CreateConnection(string userName, string password, bool useLogging)
+		{
+			IConnection ReturnValue = null;
+			Connection connection = new Connection();
+
+			connection.RedeliveryPolicy = this.redeliveryPolicy.Clone() as IRedeliveryPolicy;
+			connection.ConsumerTransformer = this.consumerTransformer;
+			connection.ProducerTransformer = this.producerTransformer;
+			connection.BrokerUri = this.BrokerUri;
+			connection.ClientId = this.clientID;
+			ReturnValue = connection;
+
+			return ReturnValue;
+		}
+
+		/// <summary>
+		/// Get/or set the broker Uri.
+		/// </summary>
+		public Uri BrokerUri
+		{
+			get { return brokerUri; }
+			set { brokerUri = value; }
+		}
+
+		/// <summary>
+		/// Get/or set the redelivery policy that new IConnection objects are
+		/// assigned upon creation.
+		/// </summary>
+		public IRedeliveryPolicy RedeliveryPolicy
+		{
+			get { return this.redeliveryPolicy; }
+			set
+			{
+				if(value != null)
+				{
+					this.redeliveryPolicy = value;
+				}
+			}
+		}
+
+		private ConsumerTransformerDelegate consumerTransformer;
+		public ConsumerTransformerDelegate ConsumerTransformer
+		{
+			get { return this.consumerTransformer; }
+			set { this.consumerTransformer = value; }
+		}
+
+		private ProducerTransformerDelegate producerTransformer;
+		public ProducerTransformerDelegate ProducerTransformer
+		{
+			get { return this.producerTransformer; }
+			set { this.producerTransformer = value; }
+		}
+	}
+}

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ConnectionMetaData.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ConnectionMetaData.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ConnectionMetaData.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ConnectionMetaData.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,107 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Reflection;
+
+namespace Apache.NMS.ZMQ
+{
+	/// <summary>
+	/// Implements the Connection Meta-Data feature for Apache.NMS.ZMQ
+	/// </summary>
+	public class ConnectionMetaData : IConnectionMetaData
+	{
+		private int nmsMajorVersion;
+		private int nmsMinorVersion;
+
+		private string nmsProviderName;
+		private string nmsVersion;
+
+		private int providerMajorVersion;
+		private int providerMinorVersion;
+		private string providerVersion;
+
+		private string[] nmsxProperties;
+
+		public ConnectionMetaData()
+		{
+			Assembly self = Assembly.GetExecutingAssembly();
+			AssemblyName asmName = self.GetName();
+
+			this.nmsProviderName = asmName.Name;
+			this.providerMajorVersion = asmName.Version.Major;
+			this.providerMinorVersion = asmName.Version.Minor;
+			this.providerVersion = asmName.Version.ToString();
+
+			this.nmsxProperties = new String[] { };
+
+			foreach(AssemblyName name in self.GetReferencedAssemblies())
+			{
+				if(0 == string.Compare(name.Name, "Apache.NMS", true))
+				{
+					this.nmsMajorVersion = name.Version.Major;
+					this.nmsMinorVersion = name.Version.Minor;
+					this.nmsVersion = name.Version.ToString();
+
+					return;
+				}
+			}
+
+			throw new NMSException("Could not find a reference to the Apache.NMS Assembly.");
+		}
+
+		public int NMSMajorVersion
+		{
+			get { return this.nmsMajorVersion; }
+		}
+
+		public int NMSMinorVersion
+		{
+			get { return this.nmsMinorVersion; }
+		}
+
+		public string NMSProviderName
+		{
+			get { return this.nmsProviderName; }
+		}
+
+		public string NMSVersion
+		{
+			get { return this.nmsVersion; }
+		}
+
+		public string[] NMSXPropertyNames
+		{
+			get { return this.nmsxProperties; }
+		}
+
+		public int ProviderMajorVersion
+		{
+			get { return this.providerMajorVersion; }
+		}
+
+		public int ProviderMinorVersion
+		{
+			get { return this.providerMinorVersion; }
+		}
+
+		public string ProviderVersion
+		{
+			get { return this.providerVersion; }
+		}
+	}
+}

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/DefaultMessageConverter.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/DefaultMessageConverter.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/DefaultMessageConverter.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/DefaultMessageConverter.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+using System;
+
+namespace Apache.NMS.ZMQ
+{
+	public enum NMSMessageType
+	{
+		BaseMessage,
+		TextMessage,
+		BytesMessage,
+		ObjectMessage,
+		MapMessage,
+		StreamMessage
+	}
+
+	public class DefaultMessageConverter : IMessageConverter
+	{
+		/// <summary>
+		/// Converts 0MQ message to NMS message
+		/// </summary>
+		/// <param name="message">
+		/// 0MQ message object
+		/// </param>
+		/// <returns>
+		/// NMS message object
+		/// </returns>
+		public virtual IMessage ToNmsMessage(ZmqMessage message)
+		{
+			BaseMessage answer = CreateNmsMessage(message);
+
+			try
+			{
+				//answer.NMSCorrelationID = message.ClientId;
+				answer.NMSMessageId = "";
+				answer.NMSDestination = message.Destination;
+				answer.NMSDeliveryMode = MsgDeliveryMode.NonPersistent;
+				answer.NMSPriority = MsgPriority.Normal;
+				answer.NMSTimestamp = System.DateTime.Now;
+				answer.NMSTimeToLive = new System.TimeSpan(0);
+				answer.NMSType = "";
+			}
+			catch(InvalidOperationException)
+			{
+				// Log error
+			}
+			return answer;
+		}
+
+		/// <summary>
+		/// Create base NMS message from 0MQ message 
+		/// </summary>
+		/// <param name="message"></param>
+		/// <returns></returns>
+		protected virtual BaseMessage CreateNmsMessage(ZmqMessage message)
+		{
+			TextMessage textMessage = new TextMessage();
+			textMessage.Text = message.Text;
+			return textMessage;
+		}
+	}
+}

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Destination.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Destination.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Destination.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Destination.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,155 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Apache.NMS.ZMQ
+{
+	/// <summary>
+	/// Summary description for Destination.
+	/// </summary>
+	public abstract class Destination : IDestination
+	{
+
+		private String name = "";
+
+		/// <summary>
+		/// The Default Constructor
+		/// </summary>
+		protected Destination()
+		{
+		}
+
+		/// <summary>
+		/// Construct the Destination with a defined physical name.
+		/// </summary>
+		/// <param name="name"></param>
+		protected Destination(String destName)
+		{
+			Name = destName;
+		}
+
+		public String Name
+		{
+			get { return this.name; }
+			set
+			{
+				this.name = value;
+				if(!this.name.Contains("\\"))
+				{
+					// Destinations must have paths in them.  If no path specified, then
+					// default to local machine.
+					this.name = ".\\" + this.name;
+				}
+			}
+		}
+
+		public bool IsTopic
+		{
+			get
+			{
+				return DestinationType == DestinationType.Topic
+					|| DestinationType == DestinationType.TemporaryTopic;
+			}
+		}
+
+		public bool IsQueue
+		{
+			get
+			{
+				return DestinationType == DestinationType.Queue
+					|| DestinationType == DestinationType.TemporaryQueue;
+			}
+		}
+
+		public bool IsTemporary
+		{
+			get
+			{
+				return DestinationType == DestinationType.TemporaryQueue
+					|| DestinationType == DestinationType.TemporaryTopic;
+			}
+		}
+
+		/// <summary>
+		/// </summary>
+		/// <returns>string representation of this instance</returns>
+		public override String ToString()
+		{
+			switch(DestinationType)
+			{
+			case DestinationType.Topic:
+				return "topic://" + Name;
+
+			case DestinationType.TemporaryTopic:
+				return "temp-topic://" + Name;
+
+			case DestinationType.TemporaryQueue:
+				return "temp-queue://" + Name;
+
+			default:
+				return "queue://" + Name;
+			}
+		}
+
+		/// <summary>
+		/// hashCode for this instance
+		/// </summary>
+		/// <returns></returns>
+		public override int GetHashCode()
+		{
+			int answer = 37;
+
+			if(this.name != null)
+			{
+				answer = name.GetHashCode();
+			}
+
+			if(IsTopic)
+			{
+				answer ^= 0xfabfab;
+			}
+
+			return answer;
+		}
+
+		/// <summary>
+		/// if the object passed in is equivalent, return true
+		/// </summary>
+		/// <param name="obj">the object to compare</param>
+		/// <returns>true if this instance and obj are equivalent</returns>
+		public override bool Equals(Object obj)
+		{
+			bool result = (this == obj);
+
+			if(!result && obj != null && obj is Destination)
+			{
+				Destination other = (Destination) obj;
+				result = (this.DestinationType == other.DestinationType
+							&& this.name.Equals(other.name));
+			}
+
+			return result;
+		}
+
+		public abstract DestinationType DestinationType
+		{
+			get;
+		}
+	}
+}
+

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/IMessageConverter.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/IMessageConverter.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/IMessageConverter.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/IMessageConverter.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+namespace Apache.NMS.ZMQ
+{
+	public interface IMessageConverter
+	{
+		/// <summary>
+		/// Convert 0mq message to nms message
+		/// </summary>
+		/// <param name="message">
+		/// 0mq message object
+		/// </param>
+		/// <returns>
+		/// nms message object
+		/// </returns>
+		IMessage ToNmsMessage(ZmqMessage message);
+	}
+}

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MapMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MapMessage.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MapMessage.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MapMessage.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,33 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using Apache.NMS.Util;
+
+namespace Apache.NMS.ZMQ
+{
+	public class MapMessage : BaseMessage, IMapMessage
+	{
+		private IPrimitiveMap body = new PrimitiveMap();
+
+		public IPrimitiveMap Body
+		{
+			get { return body; }
+			set { body = value; }
+		}
+	}
+}
+

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageConsumer.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,286 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+using System.Threading;
+using Apache.NMS.Util;
+using CLRZMQ = ZMQ;
+
+namespace Apache.NMS.ZMQ
+{
+	/// <summary>
+	/// An object capable of receiving messages from some destination
+	/// </summary>
+	public class MessageConsumer : IMessageConsumer
+	{
+		protected TimeSpan zeroTimeout = new TimeSpan(0);
+
+		private readonly Session session;
+		private readonly AcknowledgementMode acknowledgementMode;
+		private ZmqSubscriber messageSubscriber;
+		private event MessageListener listener;
+		private int listenerCount = 0;
+		private Thread asyncDeliveryThread = null;
+		private AutoResetEvent pause = new AutoResetEvent(false);
+		private Atomic<bool> asyncDelivery = new Atomic<bool>(false);
+
+		private ConsumerTransformerDelegate consumerTransformer;
+		public ConsumerTransformerDelegate ConsumerTransformer
+		{
+			get { return this.consumerTransformer; }
+			set { this.consumerTransformer = value; }
+		}
+
+		public MessageConsumer(Session session, AcknowledgementMode acknowledgementMode, ZmqSubscriber messageSubscriber)
+		{
+			this.session = session;
+			this.acknowledgementMode = acknowledgementMode;
+			this.messageSubscriber = messageSubscriber;
+		}
+
+		public event MessageListener Listener
+		{
+			add
+			{
+				listener += value;
+				listenerCount++;
+				StartAsyncDelivery();
+			}
+
+			remove
+			{
+				if(listenerCount > 0)
+				{
+					listener -= value;
+					listenerCount--;
+				}
+
+				if(0 == listenerCount)
+				{
+					StopAsyncDelivery();
+				}
+			}
+		}
+
+		/// <summary>
+		/// Receive message from subscriber
+		/// </summary>
+		/// <returns>
+		/// message interface
+		/// </returns>
+		public IMessage Receive()
+		{
+			IMessage nmsMessage = null;
+			if(null != messageSubscriber)
+			{
+				string messageText = messageSubscriber.Subscriber.Recv(System.Text.Encoding.ASCII, CLRZMQ.SendRecvOpt.NOBLOCK);
+				if(!string.IsNullOrEmpty(messageText))
+				{
+					nmsMessage = ToNmsMessage(messageText);
+				}
+			}
+			return nmsMessage;
+		}
+
+		/// <summary>
+		/// Receive message from subscriber
+		/// </summary>
+		/// <returns>
+		/// message interface
+		/// </returns>
+		public IMessage Receive(TimeSpan timeout)
+		{
+			IMessage nmsMessage = null;
+			if(null != messageSubscriber)
+			{
+				string messageText = messageSubscriber.Subscriber.Recv(System.Text.Encoding.ASCII, timeout.Milliseconds);
+				if(!string.IsNullOrEmpty(messageText))
+				{
+					nmsMessage = ToNmsMessage(messageText);
+				}
+			}
+			return nmsMessage;
+		}
+
+		/// <summary>
+		/// Receive message from subscriber
+		/// </summary>
+		/// <returns>
+		/// message interface
+		/// </returns>
+		public IMessage ReceiveNoWait()
+		{
+			return Receive(zeroTimeout);
+		}
+
+		/// <summary>
+		/// Clean up
+		/// </summary>
+		public void Dispose()
+		{
+			Close();
+		}
+
+		/// <summary>
+		/// Clean up
+		/// </summary>
+		public void Close()
+		{
+			StopAsyncDelivery();
+			if(null != messageSubscriber)
+			{
+				messageSubscriber.Dispose();
+				messageSubscriber = null;
+			}
+		}
+
+		protected virtual void StopAsyncDelivery()
+		{
+			if(asyncDelivery.CompareAndSet(true, false))
+			{
+				if(null != asyncDeliveryThread)
+				{
+					Tracer.Info("Stopping async delivery thread.");
+					pause.Set();
+					if(!asyncDeliveryThread.Join(10000))
+					{
+						Tracer.Info("Aborting async delivery thread.");
+						asyncDeliveryThread.Abort();
+					}
+
+					asyncDeliveryThread = null;
+					Tracer.Info("Async delivery thread stopped.");
+				}
+			}
+		}
+
+		protected virtual void StartAsyncDelivery()
+		{
+			if(asyncDelivery.CompareAndSet(false, true))
+			{
+				asyncDeliveryThread = new Thread(new ThreadStart(DispatchLoop));
+				asyncDeliveryThread.Name = "Message Consumer Dispatch: " + messageSubscriber.Binding;
+				asyncDeliveryThread.IsBackground = true;
+				asyncDeliveryThread.Start();
+			}
+		}
+
+		protected virtual void DispatchLoop()
+		{
+			Tracer.Info("Starting dispatcher thread consumer: " + this);
+
+			while(asyncDelivery.Value)
+			{
+				try
+				{
+					IMessage message = Receive();
+					if(asyncDelivery.Value && message != null)
+					{
+						try
+						{
+							listener(message);
+						}
+						catch(Exception e)
+						{
+							HandleAsyncException(e);
+						}
+					}
+				}
+				catch(ThreadAbortException ex)
+				{
+					Tracer.InfoFormat("Thread abort received in thread: {0} : {1}", this, ex.Message);
+					break;
+				}
+				catch(Exception ex)
+				{
+					Tracer.ErrorFormat("Exception while receiving message in thread: {0} : {1}", this, ex.Message);
+				}
+			}
+			Tracer.Info("Stopping dispatcher thread consumer: " + this);
+		}
+
+		protected virtual void HandleAsyncException(Exception e)
+		{
+			session.Connection.HandleException(e);
+		}
+
+		/// <summary>
+		/// Create nms message object
+		/// </summary>
+		/// <param name="message">
+		/// zmq message object
+		/// </param>
+		/// <returns>
+		/// nms message object
+		/// </returns>
+		protected virtual IMessage ToNmsMessage(ZmqMessage message)
+		{
+			IMessage ReturnValue = null;
+			if(null == message)
+			{
+				return ReturnValue;
+			}
+
+			ReturnValue = session.MessageConverter.ToNmsMessage(message);
+
+			if(this.ConsumerTransformer != null)
+			{
+				IMessage newMessage = ConsumerTransformer(this.session, this, ReturnValue);
+				if(newMessage != null)
+				{
+					ReturnValue = newMessage;
+				}
+			}
+			return ReturnValue;
+		}
+
+		/// <summary>
+		/// Create nms message object
+		/// </summary>
+		/// <param name="message">
+		/// message text
+		/// </param>
+		/// <returns>
+		/// nms message object
+		/// </returns>
+		protected virtual IMessage ToNmsMessage(string messageText)
+		{
+			IMessage ReturnValue = null;
+			ZmqMessage message = ToZmqMessage(messageText);
+			ReturnValue = ToNmsMessage(message);
+			return ReturnValue;
+		}
+
+		/// <summary>
+		/// Create zmq message object 
+		/// </summary>
+		/// <param name="messageText">
+		/// message text
+		/// </param>
+		/// <returns>
+		/// zmq message object
+		/// </returns>
+		private ZmqMessage ToZmqMessage(string messageText)
+		{
+			ZmqMessage message = new ZmqMessage();
+			message.Destination = new Queue(session.Connection.BrokerUri.LocalPath);
+			message.ClientId = session.Connection.ClientId;
+			message.Text = messageText;
+			return message;
+		}
+	}
+}

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageProducer.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageProducer.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageProducer.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/MessageProducer.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,168 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Apache.NMS.ZMQ
+{
+	/// <summary>
+	/// An object capable of sending messages to some destination
+	/// </summary>
+	public class MessageProducer : IMessageProducer
+	{
+
+		private readonly Session session;
+		private Destination destination;
+
+		//private long messageCounter;
+		private MsgDeliveryMode deliveryMode;
+		private TimeSpan timeToLive;
+		private MsgPriority priority;
+		private bool disableMessageID;
+		private bool disableMessageTimestamp;
+
+		private ProducerTransformerDelegate producerTransformer;
+		public ProducerTransformerDelegate ProducerTransformer
+		{
+			get { return this.producerTransformer; }
+			set { this.producerTransformer = value; }
+		}
+
+		public MessageProducer(Session session, Destination destination)
+		{
+			this.session = session;
+			this.destination = destination;
+			if(destination != null)
+			{
+			}
+		}
+
+		public void Send(IMessage message)
+		{
+			Send(Destination, message);
+		}
+
+		public void Send(IMessage message, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
+		{
+			Send(Destination, message, deliveryMode, priority, timeToLive);
+		}
+
+		public void Send(IDestination destination, IMessage message)
+		{
+			Send(destination, message, DeliveryMode, Priority, TimeToLive);
+		}
+
+		public void Send(IDestination destination, IMessage message, MsgDeliveryMode deliveryMode, MsgPriority priority, TimeSpan timeToLive)
+		{
+			// TODO: Implement sending a message.
+		}
+
+		public void Close()
+		{
+		}
+
+		public void Dispose()
+		{
+			Close();
+		}
+
+		public IMessage CreateMessage()
+		{
+			return session.CreateMessage();
+		}
+
+		public ITextMessage CreateTextMessage()
+		{
+			return session.CreateTextMessage();
+		}
+
+		public ITextMessage CreateTextMessage(String text)
+		{
+			return session.CreateTextMessage(text);
+		}
+
+		public IMapMessage CreateMapMessage()
+		{
+			return session.CreateMapMessage();
+		}
+
+		public IObjectMessage CreateObjectMessage(Object body)
+		{
+			return session.CreateObjectMessage(body);
+		}
+
+		public IBytesMessage CreateBytesMessage()
+		{
+			return session.CreateBytesMessage();
+		}
+
+		public IBytesMessage CreateBytesMessage(byte[] body)
+		{
+			return session.CreateBytesMessage(body);
+		}
+
+		public IStreamMessage CreateStreamMessage()
+		{
+			return session.CreateStreamMessage();
+		}
+
+		public MsgDeliveryMode DeliveryMode
+		{
+			get { return deliveryMode; }
+			set { deliveryMode = value; }
+		}
+
+		public TimeSpan TimeToLive
+		{
+			get { return timeToLive; }
+			set { timeToLive = value; }
+		}
+
+		/// <summary>
+		/// The default timeout for network requests.
+		/// </summary>
+		public TimeSpan RequestTimeout
+		{
+			get { return NMSConstants.defaultRequestTimeout; }
+			set { }
+		}
+
+		public IDestination Destination
+		{
+			get { return destination; }
+			set { destination = (Destination) value; }
+		}
+
+		public MsgPriority Priority
+		{
+			get { return priority; }
+			set { priority = value; }
+		}
+
+		public bool DisableMessageID
+		{
+			get { return disableMessageID; }
+			set { disableMessageID = value; }
+		}
+
+		public bool DisableMessageTimestamp
+		{
+			get { return disableMessageTimestamp; }
+			set { disableMessageTimestamp = value; }
+		}
+	}
+}

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ObjectMessage.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ObjectMessage.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ObjectMessage.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/ObjectMessage.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System.IO;
+using System.Runtime.Serialization;
+using System.Runtime.Serialization.Formatters.Binary;
+
+namespace Apache.NMS.ZMQ
+{
+	public class ObjectMessage : BaseMessage, IObjectMessage
+	{
+		private object body;
+		private IFormatter formatter;
+
+		public ObjectMessage()
+		{
+		}
+
+		public ObjectMessage(object body)
+		{
+			this.body = body;
+		}
+
+		public object Body
+		{
+			get
+			{
+				if(body == null)
+				{
+					body = Formatter.Deserialize(new MemoryStream(Content));
+				}
+
+				return body;
+			}
+
+			set
+			{
+				body = value;
+			}
+		}
+
+
+		public IFormatter Formatter
+		{
+			get
+			{
+				if(formatter == null)
+				{
+					formatter = new BinaryFormatter();
+				}
+				return formatter;
+			}
+
+			set
+			{
+				formatter = value;
+			}
+		}
+	}
+}

Added: activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Queue.cs
URL: http://svn.apache.org/viewvc/activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Queue.cs?rev=1144423&view=auto
==============================================================================
--- activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Queue.cs (added)
+++ activemq/activemq-dotnet/Apache.NMS.ZMQ/trunk/src/main/csharp/Queue.cs Fri Jul  8 18:55:17 2011
@@ -0,0 +1,52 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+using System;
+
+namespace Apache.NMS.ZMQ
+{
+	/// <summary>
+	/// Summary description for Queue.
+	/// </summary>
+	public class Queue : Destination, IQueue
+	{
+		public Queue()
+			: base()
+		{
+		}
+
+		public Queue(String name)
+			: base(name)
+		{
+		}
+
+		override public DestinationType DestinationType
+		{
+			get { return DestinationType.Queue; }
+		}
+
+		#region IQueue Members
+
+		public string QueueName
+		{
+			get { return Name; }
+		}
+
+		#endregion
+	}
+}
+



Mime
View raw message