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 2010/06/15 19:51:11 UTC
svn commit: r954983 [1/2] - in /qpid/trunk/qpid/cpp/bindings/qpid/dotnet: ./
examples/csharp.direct.receiver/ examples/csharp.direct.sender/
examples/csharp.example.client/ examples/csharp.example.client/Properties/
examples/csharp.example.declare_queu...
Author: tross
Date: Tue Jun 15 17:51:10 2010
New Revision: 954983
URL: http://svn.apache.org/viewvc?rev=954983&view=rev
Log:
QPID-2589 - Patch from Chuck Rolke
More API cleanup and new examples (to match the examples for other languages)
Added:
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/Properties/
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/Properties/AssemblyInfo.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/Properties/
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/Properties/AssemblyInfo.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/csharp.example.declare_queues.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/csharp.example.declare_queues.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Options.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Properties/
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Properties/AssemblyInfo.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/csharp.example.drain.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/csharp.example.drain.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/Properties/
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/Properties/AssemblyInfo.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/csharp.example.server.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/csharp.example.server.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Options.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Properties/
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Properties/AssemblyInfo.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/csharp.example.spout.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/csharp.example.spout.csproj
Modified:
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/csharp.direct.receiver.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/csharp.direct.receiver.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/csharp.map.callback.sender.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/csharp.map.callback.sender.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/csharp.map.receiver.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/csharp.map.recevier.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/csharp.map.sender.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/csharp.map.sender.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sln
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Message.cpp
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Message.h
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Session.cpp
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/Session.h
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/src/sessionreceiver/org.apache.qpid.messaging.sessionreceiver.csproj
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/test/messaging.test/messaging.test.cs
qpid/trunk/qpid/cpp/bindings/qpid/dotnet/test/messaging.test/messaging.test.csproj
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/csharp.direct.receiver.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/csharp.direct.receiver.cs?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/csharp.direct.receiver.cs (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/csharp.direct.receiver.cs Tue Jun 15 17:51:10 2010
@@ -32,6 +32,7 @@ namespace CSharpDirect
// Direct receiver example
//
// Receive 10 messages from localhost:5672, amq.direct/key
+ // Messages are assumed to be printable strings.
//
static void Main(string[] args)
{
@@ -52,39 +53,27 @@ namespace CSharpDirect
Console.WriteLine("nMsg : {0}", nMsg);
Console.WriteLine();
- Connection conn = new Connection(host);
-
- conn.Open();
-
- if (!conn.IsOpen())
- {
- Console.WriteLine("Failed to open connection to host : {0}", host);
- }
- else
+ Connection connection = null;
+ try
{
-
- Session sess = conn.CreateSession();
-
- Duration dura = new Duration(3600000); // wait forever
-
- Receiver rcv = sess.CreateReceiver(addr);
-
- Message msg = new Message("");
-
- for (int i = 0; i < nMsg; i++)
- {
- try
- {
- Message msg2 = rcv.Fetch(dura);
+ connection = new Connection(host);
+ connection.Open();
+ if (!connection.IsOpen()) {
+ Console.WriteLine("Failed to open connection to host : {0}", host);
+ } else {
+ Session session = connection.CreateSession();
+ Receiver receiver = session.CreateReceiver(addr);
+ Message message = new Message("");
+ for (int i = 0; i < nMsg; i++) {
+ Message msg2 = receiver.Fetch(DurationConstants.FORVER);
Console.WriteLine("Rcvd msg {0} : {1}", i, msg2.GetContent());
}
- catch (Exception e)
- {
- Console.WriteLine("Exception {0}.", e);
- }
+ connection.Close();
}
-
- conn.Close();
+ } catch (Exception e) {
+ Console.WriteLine("Exception {0}.", e);
+ if (null != connection)
+ connection.Close();
}
}
}
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/csharp.direct.receiver.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/csharp.direct.receiver.csproj?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/csharp.direct.receiver.csproj (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/csharp.direct.receiver.csproj Tue Jun 15 17:51:10 2010
@@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
+ <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{52F880E7-D677-4C91-8516-D679CE0F46A8}</ProjectGuid>
<OutputType>Exe</OutputType>
@@ -67,7 +67,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
<Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
- <Name>org.apache.qpid.messaging</Name>
+ <Name>Org.Apache.Qpid.Messaging</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.cs Tue Jun 15 17:51:10 2010
@@ -29,6 +29,11 @@ namespace csharp.direct.sender
{
class Program
{
+ // Direct sender example
+ //
+ // Send 10 messages from localhost:5672, amq.direct/key
+ // Messages are assumed to be printable strings.
+ //
static void Main(string[] args)
{
String host = "localhost:5672";
@@ -48,28 +53,27 @@ namespace csharp.direct.sender
Console.WriteLine("nMsg : {0}", nMsg);
Console.WriteLine();
- Connection conn = new Connection(host);
-
- conn.Open();
-
- if (!conn.IsOpen())
- {
- Console.WriteLine("Failed to open connection to host : {0}", host);
- }
- else
+ Connection connection = null;
+ try
{
- Session sess = conn.CreateSession();
+ connection = new Connection(host);
+ connection.Open();
- Sender snd = sess.CreateSender(addr);
-
- for (int i = 0; i < nMsg; i++)
- {
- Message msg = new Message(String.Format("Test Message {0}", i));
-
- snd.Send(msg);
+ if (!connection.IsOpen()) {
+ Console.WriteLine("Failed to open connection to host : {0}", host);
+ } else {
+ Session session = connection.CreateSession();
+ Sender sender = session.CreateSender(addr);
+ for (int i = 0; i < nMsg; i++) {
+ Message message = new Message(String.Format("Test Message {0}", i));
+ sender.Send(message);
+ }
+ connection.Close();
}
-
- conn.Close();
+ } catch (Exception e) {
+ Console.WriteLine("Exception {0}.", e);
+ if (null != connection)
+ connection.Close();
}
}
}
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.csproj?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.csproj (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/csharp.direct.sender.csproj Tue Jun 15 17:51:10 2010
@@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
+ <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7B71CE78-8E78-4632-ADBE-F4D5DFAE0068}</ProjectGuid>
<OutputType>Exe</OutputType>
@@ -67,7 +67,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
<Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
- <Name>org.apache.qpid.messaging</Name>
+ <Name>Org.Apache.Qpid.Messaging</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/Properties/AssemblyInfo.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/Properties/AssemblyInfo.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/Properties/AssemblyInfo.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("csharp.direct.receiver")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("csharp.direct.receiver")]
+[assembly: AssemblyCopyright("Copyright ? 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("c60b17ab-a82c-4edf-ba95-1e88bd4c3e75")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,70 @@
+/*
+ *
+ * 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 Org.Apache.Qpid.Messaging;
+
+namespace Org.Apache.Qpid.Messaging.Examples {
+ class Client {
+ static void Main(string[] args) {
+ String url = "amqp:tcp:127.0.0.1:5672";
+
+ if (args.Length > 0)
+ url = args[0];
+
+ Connection connection = new Connection(url);
+ try
+ {
+ connection.Open();
+
+ Session session = connection.CreateSession();
+
+ Sender sender = session.CreateSender("service_queue");
+
+ Address responseQueue = new Address("#response-queue; {create:always, delete:always}");
+ Receiver receiver = session.CreateReceiver(responseQueue);
+
+ String[] s = new String[] {
+ "Twas brillig, and the slithy toves",
+ "Did gire and gymble in the wabe.",
+ "All mimsy were the borogroves,",
+ "And the mome raths outgrabe."
+ };
+
+ Message request = new Message("");
+ request.SetReplyTo(responseQueue);
+
+ for (int i = 0; i < s.Length; i++) {
+ request.SetContent(s[i]);
+ sender.Send(request);
+ Message response = receiver.Fetch();
+ Console.WriteLine("{0} -> {1}", request.GetContent(), response.GetContent());
+ }
+ connection.Close();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception {0}.", e);
+ connection.Close();
+ }
+ }
+ }
+}
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.csproj?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.csproj (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.client/csharp.example.client.csproj Tue Jun 15 17:51:10 2010
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{0DE01712-C2D1-4CA4-B42C-5856456A8696}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>csharp.example.client</RootNamespace>
+ <AssemblyName>csharp.example.client</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\..\..\src\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\..\..\src\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>..\..\..\..\..\src\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <OutputPath>..\..\..\..\..\src\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="csharp.example.client.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
+ <Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
+ <Name>Org.Apache.Qpid.Messaging</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/Properties/AssemblyInfo.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/Properties/AssemblyInfo.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/Properties/AssemblyInfo.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("csharp.direct.receiver")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("csharp.direct.receiver")]
+[assembly: AssemblyCopyright("Copyright ? 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("c60b17ab-a82c-4edf-ba95-1e88bd4c3e75")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/csharp.example.declare_queues.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/csharp.example.declare_queues.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/csharp.example.declare_queues.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/csharp.example.declare_queues.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,61 @@
+/*
+ *
+ * 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.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using Org.Apache.Qpid.Messaging;
+
+namespace Org.Apache.Qpid.Messaging.Examples {
+ class DeclareQueues {
+ //
+ // Sample invocation: csharp.example.declare_queues.exe localhost:5672 my-queue
+ //
+ static void Main(string[] args) {
+ string addr = "localhost:5672";
+ string queue = "my-queue";
+
+ if (args.Length > 0)
+ addr = args[0];
+ if (args.Length > 1)
+ queue = args[1];
+
+ Connection connection = null;
+ try
+ {
+ connection = new Connection(addr);
+ connection.Open();
+ Session session = connection.CreateSession();
+ String queueName = queue + "; {create: always}";
+ Sender sender = session.CreateSender(queueName);
+ session.Close();
+ connection.Close();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception {0}.", e);
+ if (null != connection)
+ connection.Close();
+ }
+ }
+ }
+}
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/csharp.example.declare_queues.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/csharp.example.declare_queues.csproj?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/csharp.example.declare_queues.csproj (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.declare_queues/csharp.example.declare_queues.csproj Tue Jun 15 17:51:10 2010
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{E31B349C-830C-4583-8BD9-30DA4398349F}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>csharp.example.declare_queues</RootNamespace>
+ <AssemblyName>csharp.example.declare_queues</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\..\..\src\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\..\..\src\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>..\..\..\..\..\src\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <OutputPath>..\..\..\..\..\src\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="csharp.example.declare_queues.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
+ <Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
+ <Name>Org.Apache.Qpid.Messaging</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Options.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Options.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Options.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Options.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,181 @@
+/*
+* 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 Org.Apache.Qpid.Messaging.Examples
+{
+ using System;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Diagnostics;
+ using System.IO;
+ using System.Text;
+ using System.Xml;
+
+ public class Options
+ {
+ private string url;
+ private string address;
+ private UInt64 timeout;
+ private int count;
+ private string id;
+ private string replyTo;
+ //private string[] properties;
+ //private string[] entries;
+ private string content;
+ private string connectionOptions;
+ private bool forever;
+
+ public Options(string[] args)
+ {
+ this.url = "amqp:tcp:127.0.0.1:5672";
+ this.address = "";
+ this.timeout = 0;
+ this.count = 1;
+ this.id = "";
+ this.replyTo = "";
+ this.content = "";
+ this.connectionOptions = "";
+ this.forever = false;
+ Parse(args);
+ }
+
+ private void Parse(string[] args)
+ {
+ int argCount = args.Length;
+ int current = 0;
+
+ while ((current + 1) < argCount)
+ {
+ string arg = args[current];
+ if (arg == "--broker")
+ {
+ this.url = args[++current];
+ }
+ else if (arg == "--address")
+ {
+ this.address = args[++current];
+ }
+ else if (arg == "--timeout")
+ {
+ arg = args[++current];
+ UInt64 i = UInt64.Parse(arg);
+ if (i >= 0)
+ {
+ this.timeout = i;
+ }
+ }
+ else if (arg == "--count")
+ {
+ arg = args[++current];
+ int i = int.Parse(arg);
+ if (i >= 0)
+ {
+ this.count = i;
+ }
+ }
+ else if (arg == "--id")
+ {
+ this.id = args[++current];
+ }
+ else if (arg == "--reply-to")
+ {
+ this.replyTo = args[++current];
+ }
+ else if (arg == "--properties")
+ {
+ throw new ArgumentException("TODO: properties not implemented");
+ }
+ else if (arg == "--entries")
+ {
+ throw new ArgumentException("TODO: entries not implemented");
+ }
+ else if (arg == "--content")
+ {
+ this.content = args[++current];
+ }
+ else if (arg == "--connection-options")
+ {
+ this.connectionOptions = args[++current];
+ }
+ else if (arg == "--forever")
+ {
+ this.forever = true;
+ }
+ else
+ {
+ throw new ArgumentException(String.Format("unknown argument \"{0}\"", arg));
+ }
+
+ current++;
+ }
+
+ if (current == argCount)
+ {
+ throw new ArgumentException("missing argument: address");
+ }
+
+ address = args[current];
+ }
+
+ public string Url
+ {
+ get { return this.url; }
+ }
+
+ public string Address
+ {
+ get { return this.address; }
+ }
+
+ public UInt64 Timeout
+ {
+ get { return this.timeout; }
+ }
+
+ public int Count
+ {
+ get { return this.count; }
+ }
+
+ public string Id
+ {
+ get { return this.id; }
+ }
+
+ public string ReplyTo
+ {
+ get { return this.replyTo; }
+ }
+
+ public string Content
+ {
+ get { return content; }
+ }
+
+ public string ConnectionOptions
+ {
+ get { return this.connectionOptions; }
+ }
+
+ public bool Forever
+ {
+ get { return this.forever; }
+ }
+ }
+}
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Properties/AssemblyInfo.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Properties/AssemblyInfo.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/Properties/AssemblyInfo.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("csharp.direct.receiver")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("csharp.direct.receiver")]
+[assembly: AssemblyCopyright("Copyright ? 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("c60b17ab-a82c-4edf-ba95-1e88bd4c3e75")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/csharp.example.drain.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/csharp.example.drain.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/csharp.example.drain.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/csharp.example.drain.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,85 @@
+/*
+ *
+ * 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.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using Org.Apache.Qpid.Messaging;
+
+namespace Org.Apache.Qpid.Messaging.Examples {
+ class Drain {
+ //
+ // Sample invocation: csharp.example.drain.exe --broker localhost:5672 --timeout 30 my-queue
+ //
+ static void Main(string[] args) {
+ Options options = new Options(args);
+
+ Connection connection = null;
+ try
+ {
+ connection = new Connection(options.Url, options.ConnectionOptions);
+ connection.Open();
+ Session session = connection.CreateSession();
+ Receiver receiver = session.CreateReceiver(options.Address);
+ Duration timeout = options.Forever ?
+ DurationConstants.FORVER :
+ DurationConstants.SECOND * options.Timeout;
+ Message message = new Message();
+ while (receiver.Fetch(message, timeout))
+ {
+ Dictionary<string, object> properties = new Dictionary<string, object>();
+ properties = message.GetProperties();
+ Console.Write("Message(properties={0}, content='",
+ message.MapAsString(properties));
+
+ if ("amqp/map" == message.GetContentType())
+ {
+ Dictionary<string, object> content = new Dictionary<string, object>();
+ message.GetContent(content);
+ Console.Write(message.MapAsString(content));
+ }
+ else if ("amqp/list" == message.GetContentType())
+ {
+ Collection<object> content = new Collection<object>();
+ message.GetContent(content);
+ Console.Write(message.ListAsString(content));
+ }
+ else
+ {
+ Console.Write(message.GetContent());
+ }
+ Console.WriteLine("')");
+ session.Acknowledge();
+ }
+ receiver.Close();
+ session.Close();
+ connection.Close();
+ }
+ catch (Exception e)
+ {
+ Console.WriteLine("Exception {0}.", e);
+ if (null != connection)
+ connection.Close();
+ }
+ }
+ }
+}
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/csharp.example.drain.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/csharp.example.drain.csproj?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/csharp.example.drain.csproj (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.drain/csharp.example.drain.csproj Tue Jun 15 17:51:10 2010
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{C43DEB69-8088-420B-B0CA-C699535E6D08}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>csharp.example.drain</RootNamespace>
+ <AssemblyName>csharp.example.drain</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\..\..\src\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\..\..\src\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>..\..\..\..\..\src\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <OutputPath>..\..\..\..\..\src\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="csharp.example.drain.cs" />
+ <Compile Include="Options.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
+ <Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
+ <Name>Org.Apache.Qpid.Messaging</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/Properties/AssemblyInfo.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/Properties/AssemblyInfo.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/Properties/AssemblyInfo.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("csharp.direct.receiver")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("csharp.direct.receiver")]
+[assembly: AssemblyCopyright("Copyright ? 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("c60b17ab-a82c-4edf-ba95-1e88bd4c3e75")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/csharp.example.server.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/csharp.example.server.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/csharp.example.server.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/csharp.example.server.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,61 @@
+/*
+ *
+ * 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 Org.Apache.Qpid.Messaging;
+
+namespace Org.Apache.Qpid.Messaging.Examples {
+ class Server {
+ static void Main(string[] args) {
+ String url = "amqp:tcp:127.0.0.1:5672";
+
+ if (args.Length > 0)
+ url = args[0];
+
+ try {
+ Connection connection = new Connection(url);
+ connection.Open();
+ Session session = connection.CreateSession();
+ Receiver receiver = session.CreateReceiver("service_queue; {create: always}");
+
+ while (true) {
+ Message request = receiver.Fetch();
+ Address address = request.GetReplyTo();
+
+ if (null != address) {
+ Sender sender = session.CreateSender(address);
+ String s = request.GetContent();
+ Message response = new Message(s.ToUpper());
+ sender.Send(response);
+ Console.WriteLine("Processed request: {0} -> {1}", request.GetContent(), response.GetContent());
+ session.Acknowledge();
+ } else {
+ Console.WriteLine("Error: no reply address specified for request: {0}", request.GetContent());
+ session.Reject(request);
+ }
+ }
+ // connection.Close(); // unreachable in this example
+ } catch (Exception e) {
+ Console.WriteLine("Exception {0}.", e);
+ }
+ }
+ }
+}
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/csharp.example.server.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/csharp.example.server.csproj?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/csharp.example.server.csproj (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.server/csharp.example.server.csproj Tue Jun 15 17:51:10 2010
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{090A081D-E8B5-4949-AA43-EE182B7101E3}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>csharp.example.server</RootNamespace>
+ <AssemblyName>csharp.example.server</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\..\..\src\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\..\..\src\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>..\..\..\..\..\src\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <OutputPath>..\..\..\..\..\src\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="csharp.example.server.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
+ <Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
+ <Name>Org.Apache.Qpid.Messaging</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Options.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Options.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Options.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Options.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,189 @@
+/*
+* 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 Org.Apache.Qpid.Messaging.Examples
+{
+ using System;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Collections.ObjectModel;
+ using System.Diagnostics;
+ using System.IO;
+ using System.Text;
+ using System.Xml;
+
+ public class Options
+ {
+ private string url;
+ private string address;
+ private int timeout;
+ private int count;
+ private string id;
+ private string replyTo;
+ private Collection<string> properties;
+ private Collection<string> entries;
+ private string content;
+ private string connectionOptions;
+ private bool forever;
+
+ public Options(string[] args)
+ {
+ this.url = "amqp:tcp:127.0.0.1:5672";
+ this.address = "";
+ this.timeout = 0;
+ this.count = 1;
+ this.id = "";
+ this.replyTo = "";
+ properties = new Collection<string>();
+ entries = new Collection<string>();
+ this.content = "";
+ this.connectionOptions = "";
+ this.forever = false;
+ Parse(args);
+ }
+
+ private void Parse(string[] args)
+ {
+ int argCount = args.Length;
+ int current = 0;
+
+ while ((current + 1) < argCount)
+ {
+ string arg = args[current];
+ if (arg == "--broker")
+ {
+ this.url = args[++current];
+ }
+ else if (arg == "--address")
+ {
+ this.address = args[++current];
+ }
+ else if (arg == "--timeout")
+ {
+ arg = args[++current];
+ int i = int.Parse(arg);
+ if (i >= 0)
+ {
+ this.timeout = i;
+ }
+ }
+ else if (arg == "--count")
+ {
+ arg = args[++current];
+ int i = int.Parse(arg);
+ if (i >= 0)
+ {
+ this.count = i;
+ }
+ }
+ else if (arg == "--id")
+ {
+ this.id = args[++current];
+ }
+ else if (arg == "--reply-to")
+ {
+ this.replyTo = args[++current];
+ }
+ else if (arg == "--properties")
+ {
+ this.properties.Add(args[++current]);
+ }
+ else if (arg == "--map")
+ {
+ this.entries.Add(args[++current]);
+ }
+ else if (arg == "--content")
+ {
+ this.content = args[++current];
+ }
+ else if (arg == "--connection-options")
+ {
+ this.connectionOptions = args[++current];
+ }
+ else if (arg == "--forever")
+ {
+ this.forever = true;
+ }
+ else
+ {
+ throw new ArgumentException(String.Format("unknown argument \"{0}\"", arg));
+ }
+
+ current++;
+ }
+
+ if (current == argCount)
+ {
+ throw new ArgumentException("missing argument: address");
+ }
+
+ address = args[current];
+ }
+
+ public string Url
+ {
+ get { return this.url; }
+ }
+
+ public string Address
+ {
+ get { return this.address; }
+ }
+
+ public int Timeout
+ {
+ get { return this.timeout; }
+ }
+
+ public int Count
+ {
+ get { return this.count; }
+ }
+
+ public string Id
+ {
+ get { return this.id; }
+ }
+
+ public string ReplyTo
+ {
+ get { return this.replyTo; }
+ }
+
+ public Collection<string> Entries
+ {
+ get { return this.entries; }
+ }
+
+ public string Content
+ {
+ get { return content; }
+ }
+
+ public string ConnectionOptions
+ {
+ get { return this.connectionOptions; }
+ }
+
+ public bool Forever
+ {
+ get { return this.forever; }
+ }
+ }
+}
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Properties/AssemblyInfo.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Properties/AssemblyInfo.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/Properties/AssemblyInfo.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("csharp.direct.receiver")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("csharp.direct.receiver")]
+[assembly: AssemblyCopyright("Copyright ? 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("c60b17ab-a82c-4edf-ba95-1e88bd4c3e75")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/csharp.example.spout.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/csharp.example.spout.cs?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/csharp.example.spout.cs (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/csharp.example.spout.cs Tue Jun 15 17:51:10 2010
@@ -0,0 +1,117 @@
+/*
+ *
+ * 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.Diagnostics;
+using System.Collections;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using Org.Apache.Qpid.Messaging;
+
+namespace Org.Apache.Qpid.Messaging.Examples {
+ class Spout {
+ //
+ // Sample invocation: csharp.example.drain.exe --broker localhost:5672 --timeout 30 my-queue
+ // This pro
+ static bool NameVal(string In, out string nameOut, out string valueOut)
+ {
+ int pos = In.IndexOf("=");
+ if (-1 == pos) {
+ nameOut = In;
+ valueOut = "";
+ return false;
+ } else {
+ nameOut = In.Substring(0, pos);
+ if (pos + 1 < In.Length) {
+ valueOut = In.Substring(pos + 1);
+ return true;
+ } else {
+ valueOut = "";
+ return false;
+ }
+ }
+ }
+
+ static void SetEntries(Collection<string> entries, Dictionary<string, object> content)
+ {
+ foreach (String entry in entries)
+ {
+ string name = "";
+ string value = "";
+ if (NameVal(entry, out name, out value))
+ content.Add(name, value);
+ else
+ content.Add(name, "");
+ }
+ }
+
+ static void Main(string[] args) {
+ Options options = new Options(args);
+
+ Connection connection = null;
+ try
+ {
+ connection = new Connection(options.Url);
+ connection.Open();
+ Session session = connection.CreateSession();
+ Sender sender = session.CreateSender(options.Address);
+ Message message;
+ if (options.Entries.Count > 0)
+ {
+ Dictionary<string, object> content = new Dictionary<string, object>();
+ SetEntries(options.Entries, content);
+ message = new Message(content);
+ }
+ else
+ {
+ message = new Message(options.Content);
+ message.SetContentType("text/plain");
+ }
+ Address replyToAddr = new Address(options.ReplyTo);
+
+ Stopwatch stopwatch = new Stopwatch();
+ TimeSpan timespan = new TimeSpan(0,0,options.Timeout);
+ stopwatch.Start();
+ for (int count = 0;
+ (0 == options.Count || count < options.Count) &&
+ (0 == options.Timeout || stopwatch.Elapsed <= timespan);
+ count++)
+ {
+ if ("" != options.ReplyTo) message.SetReplyTo(replyToAddr);
+ string id = options.Id ;
+ if ("" == id) {
+ Guid g = Guid.NewGuid();
+ id = g.ToString();
+ }
+ string spoutid = id + ":" + count;
+ message.SetProperty("spout-id", spoutid);
+ sender.Send(message);
+ }
+ connection.Close();
+ } catch (Exception e) {
+ Console.WriteLine("Exception {0}.", e);
+ if (null != connection)
+ connection.Close();
+ }
+ }
+ }
+}
+
Added: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/csharp.example.spout.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/csharp.example.spout.csproj?rev=954983&view=auto
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/csharp.example.spout.csproj (added)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.example.spout/csharp.example.spout.csproj Tue Jun 15 17:51:10 2010
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>9.0.21022</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{EB36626D-36C2-41B3-B65E-762BAF27F137}</ProjectGuid>
+ <OutputType>Exe</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>csharp.example.spout</RootNamespace>
+ <AssemblyName>csharp.example.spout</AssemblyName>
+ <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\..\..\..\..\src\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\..\..\..\..\src\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ <DebugSymbols>true</DebugSymbols>
+ <OutputPath>..\..\..\..\..\src\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <DebugType>full</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ <OutputPath>..\..\..\..\..\src\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <Optimize>true</Optimize>
+ <DebugType>pdbonly</DebugType>
+ <PlatformTarget>x86</PlatformTarget>
+ <ErrorReport>prompt</ErrorReport>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="System" />
+ <Reference Include="System.Core">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Xml.Linq">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data.DataSetExtensions">
+ <RequiredTargetFramework>3.5</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="csharp.example.spout.cs" />
+ <Compile Include="Options.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
+ <Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
+ <Name>Org.Apache.Qpid.Messaging</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.csproj?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.csproj (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/csharp.map.callback.receiver.csproj Tue Jun 15 17:51:10 2010
@@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
+ <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{68A43817-2358-4A31-8FDF-FE21722BFBCF}</ProjectGuid>
<OutputType>Exe</OutputType>
@@ -67,7 +67,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
<Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
- <Name>org.apache.qpid.messaging</Name>
+ <Name>Org.Apache.Qpid.Messaging</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\sessionreceiver\org.apache.qpid.messaging.sessionreceiver.csproj">
<Project>{B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}</Project>
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/csharp.map.callback.sender.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/csharp.map.callback.sender.cs?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/csharp.map.callback.sender.cs (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/csharp.map.callback.sender.cs Tue Jun 15 17:51:10 2010
@@ -100,20 +100,55 @@ namespace Org.Apache.Qpid.Messaging.Exam
Dictionary<string, object> subMap = new Dictionary<string, object>();
Collection<object> colors = new Collection<object>();
+ // add simple types
content["id"] = 987654321;
content["name"] = "Widget";
content["percent"] = 0.99;
+ // add nested amqp/map
subMap["name"] = "Smith";
subMap["number"] = 354;
+ content["nestedMap"] = subMap;
- content["nested"] = subMap;
-
+ // add an amqp/list
colors.Add("red");
colors.Add("green");
colors.Add("white");
+ content["colorsList"] = colors;
+
+ // add one of each supported amqp data type
+ bool mybool = true;
+ content["mybool"] = mybool;
+
+ byte mybyte = 4;
+ content["mybyte"] = mybyte;
+
+ UInt16 myUInt16 = 5;
+ content["myUInt16"] = myUInt16;
+
+ UInt32 myUInt32 = 6;
+ content["myUInt32"] = myUInt32;
+
+ UInt64 myUInt64 = 7;
+ content["myUInt64"] = myUInt64;
+
+ char mychar = 'h';
+ content["mychar"] = mychar;
+
+ Int16 myInt16 = 9;
+ content["myInt16"] = myInt16;
+
+ Int32 myInt32 = 10;
+ content["myInt32"] = myInt32;
+
+ Int64 myInt64 = 11;
+ content["myInt64"] = myInt64;
+
+ Single mySingle = (Single)12.12;
+ content["mySingle"] = mySingle;
- content["colors"] = colors;
+ Double myDouble = 13.13;
+ content["myDouble"] = myDouble;
//
// Construct a message with the map content and send it synchronously
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/csharp.map.callback.sender.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/csharp.map.callback.sender.csproj?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/csharp.map.callback.sender.csproj (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/csharp.map.callback.sender.csproj Tue Jun 15 17:51:10 2010
@@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
+ <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{12F1C14F-5C7D-4075-9BAE-C091394FF99A}</ProjectGuid>
<OutputType>Exe</OutputType>
@@ -69,7 +69,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
<Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
- <Name>org.apache.qpid.messaging</Name>
+ <Name>Org.Apache.Qpid.Messaging</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/csharp.map.receiver.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/csharp.map.receiver.csproj?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/csharp.map.receiver.csproj (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/csharp.map.receiver.csproj Tue Jun 15 17:51:10 2010
@@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
+ <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{AD9E53D7-DB10-4DA2-84D2-A81BE09B04E9}</ProjectGuid>
<OutputType>Exe</OutputType>
@@ -67,7 +67,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
<Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
- <Name>org.apache.qpid.messaging</Name>
+ <Name>Org.Apache.Qpid.Messaging</Name>
</ProjectReference>
<ProjectReference Include="..\..\src\sessionreceiver\org.apache.qpid.messaging.sessionreceiver.csproj">
<Project>{B0A51CEC-30A2-4C2E-90BE-AE95107EAA05}</Project>
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/csharp.map.recevier.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/csharp.map.recevier.cs?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/csharp.map.recevier.cs (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/csharp.map.recevier.cs Tue Jun 15 17:51:10 2010
@@ -27,6 +27,11 @@ namespace Org.Apache.Qpid.Messaging.exam
{
class MapReceiver
{
+ // csharp.map.receiver example
+ //
+ // Send an amqp/map message to amqp:tcp:localhost:5672 amq.direct/map_example
+ // The map message
+ //
static void Main(string[] args)
{
string url = "amqp:tcp:localhost:5672";
@@ -47,16 +52,16 @@ namespace Org.Apache.Qpid.Messaging.exam
Receiver receiver = session.CreateReceiver("amq.direct/map_example");
//
- // Fetch the message from the broker (wait indefinitely by default)
+ // Fetch the message from the broker
//
- Message message = receiver.Fetch(new Duration(60000));
+ Message message = receiver.Fetch(DurationConstants.MINUTE);
//
// Extract the structured content from the message.
//
Dictionary<string, object> content = new Dictionary<string, object>();
message.GetContent(content);
- Console.WriteLine("Received: {0}", content);
+ Console.WriteLine("Received: {0}", message.AsString(content));
//
// Acknowledge the receipt of all received messages.
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/csharp.map.sender.cs
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/csharp.map.sender.cs?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/csharp.map.sender.cs (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/csharp.map.sender.cs Tue Jun 15 17:51:10 2010
@@ -30,6 +30,12 @@ namespace Org.Apache.Qpid.Messaging.exam
{
class MapSender
{
+ // csharp.map.sender example
+ //
+ // Send an amqp/map message to amqp:tcp:localhost:5672 amq.direct/map_example
+ // The map message contains simple types, a nested amqp/map,
+ // an ampq/list, and specific instances of each supported type.
+ //
static void Main(string[] args)
{
string url = "amqp:tcp:localhost:5672";
@@ -57,20 +63,55 @@ namespace Org.Apache.Qpid.Messaging.exam
Dictionary<string, object> subMap = new Dictionary<string, object>();
Collection<object> colors = new Collection<object>();
+ // add simple types
content["id"] = 987654321;
content["name"] = "Widget";
content["percent"] = 0.99;
+ // add nested amqp/map
subMap["name"] = "Smith";
subMap["number"] = 354;
+ content["nestedMap"] = subMap;
- content["nested"] = subMap;
-
+ // add an amqp/list
colors.Add("red");
colors.Add("green");
colors.Add("white");
+ content["colorsList"] = colors;
+
+ // add one of each supported amqp data type
+ bool mybool = true;
+ content["mybool"] = mybool;
+
+ byte mybyte = 4;
+ content["mybyte"] = mybyte;
+
+ UInt16 myUInt16 = 5 ;
+ content["myUInt16"] = myUInt16;
+
+ UInt32 myUInt32 = 6;
+ content["myUInt32"] = myUInt32;
+
+ UInt64 myUInt64 = 7;
+ content["myUInt64"] = myUInt64;
+
+ char mychar = 'h';
+ content["mychar"] = mychar;
+
+ Int16 myInt16 = 9;
+ content["myInt16"] = myInt16;
+
+ Int32 myInt32 = 10;
+ content["myInt32"] = myInt32;
+
+ Int64 myInt64 = 11;
+ content["myInt64"] = myInt64;
+
+ Single mySingle = (Single)12.12;
+ content["mySingle"] = mySingle;
- content["colors"] = colors;
+ Double myDouble = 13.13;
+ content["myDouble"] = myDouble;
//
// Construct a message with the map content and send it synchronously
Modified: qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/csharp.map.sender.csproj
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/csharp.map.sender.csproj?rev=954983&r1=954982&r2=954983&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/csharp.map.sender.csproj (original)
+++ qpid/trunk/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/csharp.map.sender.csproj Tue Jun 15 17:51:10 2010
@@ -3,7 +3,7 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
- <ProductVersion>9.0.30729</ProductVersion>
+ <ProductVersion>9.0.21022</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5D8252F5-E1D3-44A0-94C7-7CB75E843C10}</ProjectGuid>
<OutputType>Exe</OutputType>
@@ -67,7 +67,7 @@
<ItemGroup>
<ProjectReference Include="..\..\src\org.apache.qpid.messaging.vcproj">
<Project>{AA5A3B83-5F98-406D-A01C-5A921467A57D}</Project>
- <Name>org.apache.qpid.messaging</Name>
+ <Name>Org.Apache.Qpid.Messaging</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org