You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2011/09/19 17:13:38 UTC
svn commit: r1172657 [2/21] - in /qpid/branches/qpid-3346/qpid: ./ cpp/
cpp/bindings/ cpp/bindings/qmf2/examples/cpp/ cpp/bindings/qpid/dotnet/
cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/Properties/
cpp/bindings/qpid/dotnet/examples/cshar...
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1 (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/configure-windows.ps1 Mon Sep 19 15:13:18 2011
@@ -24,29 +24,32 @@
# This script configures a qpid\cpp developer build environment under Windows
# to enable working with cpp\bindings\qpid\dotnet binding source code.
#
+# * Supports multiple versions of Visual Studio (VS2008, VS2010) as CMake
+# generator.
+#
# * Supports 32-bit and/or 64-bit development platforms.
#
# * User chooses in-source or out-of-source build directories.
#
# - 'In-source' builds happen when CMake is run from directory qpid\cpp.
-# Hundreds of CMake-generated output files are placed in qpid\cpp\src.
+# Hundreds of CMake-generated output files are placed in qpid\cpp\src.
# These files go right on top of files that are part of the source tree
# in qpid\cpp\src.
-# In-source builds support only one platform.
+# In-source builds support only one platform.
# Choose only a 32-bit or a 64-bit platform but not both.
#
# - Out-of-source builds happen when the user chooses another directory
# under qpid in which to run CMake. Out-of-source builds are required
-# in order to build both x86 and x64 targets using the same source tree.
+# in order to build both x86 and x64 targets using the same source tree.
# For each build platform (32-bit x86 or Win32, or 64-bit x64) the user
-# specifies a build directory and a specific version of Boost.
+# specifies a build directory and a specific version of Boost.
# Many platform/Boost-version directories may reside side by side.
#
# * User chooses to run CMake or not.
#
# - When a new build directory is created then the user is given the
-# option of running CMake in that directory. Running CMake is a
-# necessary step as CMake creates important source, solution, and
+# option of running CMake in that directory. Running CMake is a
+# necessary step as CMake creates important source, solution, and
# project files.
#
# - If a directory "looks like" is has already had CMake run in it
@@ -63,7 +66,7 @@
# 3. CMake 2.8 (or later) must be installed. The cmake\bin directory
# must be in the user's path.
# 4. Boost library specifications may or may not be in the user's path.
-# The script author recommeds not to have Boost in the path and only
+# The script author recommeds not to have Boost in the path and only
# allow the Boost path to be specified by generated command procedures.
# 5. Visual Studio build environment must be installed.
#
@@ -90,7 +93,7 @@
# In this example the build dirs are new. The script will prompt
# asking if CMake is to run in the build directories. User chooses Yes.
#
-# Now this script runs CMake twice, once each with the 32-bit and 64-bit
+# Now this script runs CMake twice, once each with the 32-bit and 64-bit
# generators.
# * This step creates qpid-cpp.sln and related project files.
# C:\svn\qpid\build32\qpid-cpp.sln
@@ -107,7 +110,7 @@
# C:\svn\qpid\build64\setenv-messaging-x64-64bit.bat
#
# Next the user compiles solution qpid\build32\qpid-cpp.sln.
-#
+#
# Using the generated scripts:
#
# Case 1. Run an executable in 32-bit mode.
@@ -142,6 +145,11 @@ $global:txtPath = '$env:PATH'
$global:txtQR = '$env:QPID_BUILD_ROOT'
$global:txtWH = 'Write-Host'
+#############################
+# Visual Studio version selection dialog items and choice
+#
+[array]$global:VsVersionCmakeChoiceList = "Visual Studio 10", "Visual Studio 9 2008"
+$global:cmakeGenerator = ''
#############################
# Select-Folder
@@ -168,7 +176,7 @@ function AskYesOrNo ($Question="No quest
[Windows.Forms.MessageBoxIcon]::Question)
$result = $dlg -eq [Windows.Forms.DialogResult]::Yes
-
+
$result
}
@@ -188,7 +196,7 @@ function SanityCheckBoostPath ($path=0)
$toTest = ('include', 'lib')
foreach ($pattern in $toTest) {
- $target = Join-Path $path $pattern
+ $target = Join-Path $path $pattern
if (!(Test-Path -path $target)) {
$result = $false
}
@@ -196,7 +204,7 @@ function SanityCheckBoostPath ($path=0)
} else {
$result = $false
}
-
+
if (! $result) {
Write-Host "The path ""$displayPath"" does not appear to be a Boost root path."
}
@@ -219,7 +227,7 @@ function SanityCheckBuildPath ($path=0)
$toTest = ('CMakeFiles', 'docs', 'etc', 'examples', 'include',
'managementgen', 'src')
foreach ($pattern in $toTest) {
- $target = Join-Path $path $pattern
+ $target = Join-Path $path $pattern
if (!(Test-Path -path $target)) {
$result = $false
}
@@ -313,7 +321,7 @@ function WriteDotnetBindingEnvSetupBat
$out = @("@ECHO OFF
REM
-REM Call this command procedure from a command prompt to set up a $vsPlatform ($nBits-bit)
+REM Call this command procedure from a command prompt to set up a $vsPlatform ($nBits-bit)
REM $slnName environment
REM
REM > call $outfileName
@@ -329,6 +337,56 @@ ECHO Environment set for $slnName $vsPla
$out | Out-File "$buildRoot\$outfileName" -encoding ASCII
}
+#############################
+# Return the SelectedItem from the dropdown list and close the form.
+#
+function Return-DropDown {
+ if ($DropDown.SelectedItem -ne $null) {
+ $global:cmakeGenerator = $DropDown.SelectedItem.ToString()
+ $Form.Close()
+ Write-Host "Selected generator: $global:cmakeGenerator"
+ }
+}
+
+#############################
+# Create the CMake generator form and launch it
+#
+function SelectCMakeGenerator {
+
+ $Form = New-Object System.Windows.Forms.Form
+
+ $Form.width = 350
+ $Form.height = 150
+ $Form.Text = Select CMake Generator
+
+ $DropDown = new-object System.Windows.Forms.ComboBox
+ $DropDown.Location = new-object System.Drawing.Size(120,10)
+ $DropDown.Size = new-object System.Drawing.Size(150,30)
+
+ ForEach ($Item in $global:VsVersionCmakeChoiceList) {
+ $DropDown.Items.Add($Item)
+ }
+ $DropDown.SelectedIndex = 0
+
+ $Form.Controls.Add($DropDown)
+
+ $DropDownLabel = new-object System.Windows.Forms.Label
+ $DropDownLabel.Location = new-object System.Drawing.Size(10,10)
+ $DropDownLabel.size = new-object System.Drawing.Size(100,20)
+ $DropDownLabel.Text = "CMake generators"
+ $Form.Controls.Add($DropDownLabel)
+
+ $Button = new-object System.Windows.Forms.Button
+ $Button.Location = new-object System.Drawing.Size(120,50)
+ $Button.Size = new-object System.Drawing.Size(120,20)
+ $Button.Text = "Select a generator"
+ $Button.Add_Click({Return-DropDown})
+ $form.Controls.Add($Button)
+
+ $Form.Add_Shown({$Form.Activate()})
+ $Form.ShowDialog()
+}
+
#############################
# Main
@@ -341,6 +399,12 @@ ECHO Environment set for $slnName $vsPla
[string] $cppDir = Resolve-Path (Join-Path $curDir "..\..\..")
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null
+[System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") | Out-Null
+
+#############################
+# User dialog to select a version of Visual Studio as CMake generator
+#
+SelectCMakeGenerator
#############################
# User dialog to get optional 32-bit boost and build paths
@@ -412,7 +476,7 @@ if ($make32) {
$env:BOOST_ROOT = "$boost32"
cd "$build32"
Write-Host "Running 32-bit CMake in $build32 ..."
- CMake -G "Visual Studio 9 2008" "-DCMAKE_INSTALL_PREFIX=install_x86" $cppDir
+ CMake -G "$global:cmakeGenerator" "-DCMAKE_INSTALL_PREFIX=install_x86" $cppDir
} else {
Write-Host "Skipped 32-bit CMake."
}
@@ -424,7 +488,7 @@ if ($make64) {
$env:BOOST_ROOT = "$boost64"
cd "$build64"
Write-Host "Running 64-bit CMake in $build64"
- CMake -G "Visual Studio 9 2008 Win64" "-DCMAKE_INSTALL_PREFIX=install_x64" $cppDir
+ CMake -G "$global:cmakeGenerator Win64" "-DCMAKE_INSTALL_PREFIX=install_x64" $cppDir
} else {
Write-Host "Skipped 64-bit CMake."
}
@@ -437,7 +501,7 @@ if ($make64) {
if ($defined32) {
Write-Host "Writing 32-bit scripts..."
-
+
###########
# Powershell script to launch org.apache.qpid.messaging.sln
#
@@ -448,8 +512,8 @@ if ($defined32) {
-vsPlatform "x86" `
-nBits "32" `
-outfileName "start-devenv-messaging-x86-32bit.ps1"
-
-
+
+
###########
# Batch script (that you doubleclick) to launch powershell script
# that launches org.apache.qpid.messaging.sln.
@@ -482,7 +546,7 @@ if ($defined32) {
if ($defined64) {
Write-Host "Writing 64-bit scripts..."
-
+
###########
# Powershell script to launch org.apache.qpid.messaging.sln
#
@@ -493,8 +557,8 @@ if ($defined64) {
-vsPlatform "x64" `
-nBits "64" `
-outfileName "start-devenv-messaging-x64-64bit.ps1"
-
-
+
+
###########
# Batch script (that you doubleclick) to launch powershell script
# that launches org.apache.qpid.messaging.sln.
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/Properties/AssemblyInfo.cs?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/Properties/AssemblyInfo.cs (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.receiver/Properties/AssemblyInfo.cs Mon Sep 19 15:13:18 2011
@@ -7,9 +7,9 @@
* 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
@@ -23,7 +23,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// 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")]
@@ -31,12 +31,12 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("csharp.direct.receiver")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyCopyright("Copyright 2011")]
[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
+// 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)]
@@ -46,11 +46,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Build and Revision Numbers
+// 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")]
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/Properties/AssemblyInfo.cs?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/Properties/AssemblyInfo.cs (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.direct.sender/Properties/AssemblyInfo.cs Mon Sep 19 15:13:18 2011
@@ -7,9 +7,9 @@
* 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
@@ -23,7 +23,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// 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.sender")]
@@ -31,12 +31,12 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("csharp.direct.sender")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyCopyright("Copyright 2011")]
[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
+// 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)]
@@ -46,11 +46,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Build and Revision Numbers
+// 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")]
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/Properties/AssemblyInfo.cs?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/Properties/AssemblyInfo.cs (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.receiver/Properties/AssemblyInfo.cs Mon Sep 19 15:13:18 2011
@@ -20,7 +20,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// 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.map.callback.receiver")]
@@ -28,12 +28,12 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("csharp.map.callback.receiver")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyCopyright("Copyright 2011")]
[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
+// 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)]
@@ -43,11 +43,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Build and Revision Numbers
+// 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")]
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/Properties/AssemblyInfo.cs?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/Properties/AssemblyInfo.cs (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.callback.sender/Properties/AssemblyInfo.cs Mon Sep 19 15:13:18 2011
@@ -28,7 +28,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("csharp.map.callback.sender")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyCopyright("Copyright 2010")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/Properties/AssemblyInfo.cs?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/Properties/AssemblyInfo.cs (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.receiver/Properties/AssemblyInfo.cs Mon Sep 19 15:13:18 2011
@@ -7,9 +7,9 @@
* 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
@@ -23,7 +23,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// 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.map.receiver")]
@@ -31,12 +31,12 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("csharp.map.receiver")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyCopyright("Copyright 2011")]
[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
+// 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)]
@@ -46,11 +46,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Build and Revision Numbers
+// 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")]
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/Properties/AssemblyInfo.cs?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/Properties/AssemblyInfo.cs (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/csharp.map.sender/Properties/AssemblyInfo.cs Mon Sep 19 15:13:18 2011
@@ -7,9 +7,9 @@
* 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
@@ -23,7 +23,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// 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.map.sender")]
@@ -31,12 +31,12 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("csharp.map.sender")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyCopyright("Copyright 2011")]
[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
+// 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)]
@@ -46,11 +46,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Build and Revision Numbers
+// 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")]
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/visualbasic.example.client/MyProject/AssemblyInfo.vb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/visualbasic.example.client/MyProject/AssemblyInfo.vb?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/visualbasic.example.client/MyProject/AssemblyInfo.vb (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/examples/visualbasic.example.client/MyProject/AssemblyInfo.vb Mon Sep 19 15:13:18 2011
@@ -6,9 +6,9 @@
' 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
@@ -21,34 +21,34 @@ Imports System
Imports System.Reflection
Imports System.Runtime.InteropServices
-' General Information about an assembly is controlled through the following
+' 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.
' Review the values of the assembly attributes
-<Assembly: AssemblyTitle("visualbasic.example.client")>
-<Assembly: AssemblyDescription("")>
-<Assembly: AssemblyCompany("Microsoft")>
-<Assembly: AssemblyProduct("visualbasic.example.client")>
-<Assembly: AssemblyCopyright("Copyright © Microsoft 2010")>
-<Assembly: AssemblyTrademark("")>
+<Assembly: AssemblyTitle("visualbasic.example.client")>
+<Assembly: AssemblyDescription("")>
+<Assembly: AssemblyCompany("")>
+<Assembly: AssemblyProduct("visualbasic.example.client")>
+<Assembly: AssemblyCopyright("Copyright 2011")>
+<Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)>
'The following GUID is for the ID of the typelib if this project is exposed to COM
-<Assembly: Guid("ec9df8cf-c1d4-4938-9e72-93fb81d55700")>
+<Assembly: Guid("ec9df8cf-c1d4-4938-9e72-93fb81d55700")>
' Version information for an assembly consists of the following four values:
'
' Major Version
-' Minor Version
+' Minor Version
' Build Number
' Revision
'
-' You can specify all the values or you can default the Build and Revision Numbers
+' 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.*")>
-<Assembly: AssemblyVersion("1.0.0.0")>
-<Assembly: AssemblyFileVersion("1.0.0.0")>
+<Assembly: AssemblyVersion("1.0.0.0")>
+<Assembly: AssemblyFileVersion("1.0.0.0")>
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/org.apache.qpid.messaging.sessionreceiver.sln Mon Sep 19 15:13:18 2011
@@ -1,6 +1,6 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
-#
+#
# 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
@@ -8,9 +8,9 @@ Microsoft Visual Studio Solution File, F
# 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
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/test/messaging.test/Properties/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/test/messaging.test/Properties/AssemblyInfo.cs?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/test/messaging.test/Properties/AssemblyInfo.cs (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/dotnet/test/messaging.test/Properties/AssemblyInfo.cs Mon Sep 19 15:13:18 2011
@@ -7,9 +7,9 @@
* 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
@@ -23,7 +23,7 @@ using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
-// General Information about an assembly is controlled through the following
+// 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("messaging.test")]
@@ -31,12 +31,12 @@ using System.Runtime.InteropServices;
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("messaging.test")]
-[assembly: AssemblyCopyright("Copyright © 2010")]
+[assembly: AssemblyCopyright("Copyright 2011")]
[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
+// 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)]
@@ -46,11 +46,11 @@ using System.Runtime.InteropServices;
// Version information for an assembly consists of the following four values:
//
// Major Version
-// Minor Version
+// Minor Version
// Build Number
// Revision
//
-// You can specify all the values or you can default the Build and Revision Numbers
+// 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")]
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/python/python.i
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/python/python.i?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/python/python.i (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/python/python.i Mon Sep 19 15:13:18 2011
@@ -21,21 +21,357 @@
%include "std_string.i"
%include "../../swig_python_typemaps.i"
+/* Needed for get/setPriority methods. Surprising SWIG 1.3.40 doesn't
+ * convert uint8_t by default. */
+%apply unsigned char { uint8_t };
+
+
+/*
+ * Exceptions
+ *
+ * The convention below is that exceptions in _cqpid.so have the same
+ * names as in the C++ library. They get renamed to their Python
+ * equivalents when brought into the Python wrapping
+ */
+%{
+static PyObject* pNoMessageAvailable;
+static PyObject* pTargetCapacityExceeded;
+static PyObject* pNotFound;
+static PyObject* pTransportFailure;
+%}
+
+%init %{
+ pNoMessageAvailable = PyErr_NewException(
+ "_cqpid.NoMessageAvailable", NULL, NULL);
+ Py_INCREF(pNoMessageAvailable);
+ PyModule_AddObject(m, "NoMessageAvailable", pNoMessageAvailable);
+
+ pTargetCapacityExceeded = PyErr_NewException(
+ "_cqpid.TargetCapacityExceeded", NULL, NULL);
+ Py_INCREF(pTargetCapacityExceeded);
+ PyModule_AddObject(m, "TargetCapacityExceeded", pTargetCapacityExceeded);
+
+ pNotFound = PyErr_NewException(
+ "_cqpid.NotFound", NULL, NULL);
+ Py_INCREF(pNotFound);
+ PyModule_AddObject(m, "NotFound", pNotFound);
+
+ pTransportFailure = PyErr_NewException(
+ "_cqpid.TransportFailure", NULL, NULL);
+ Py_INCREF(pTransportFailure);
+ PyModule_AddObject(m, "TransportFailure", pTransportFailure);
+%}
+
+%pythoncode %{
+ Empty = _cqpid.NoMessageAvailable
+ TargetCapacityExceeded = _cqpid.TargetCapacityExceeded
+ NotFound = _cqpid.NotFound
+ ConnectError = _cqpid.TransportFailure
+%}
+
/* Define the general-purpose exception handling */
%exception {
+ PyObject * pExceptionType = NULL;
std::string error;
Py_BEGIN_ALLOW_THREADS;
try {
$action
+ } catch (qpid::messaging::NoMessageAvailable & ex) {
+ pExceptionType = pNoMessageAvailable;
+ error = ex.what();
+ } catch (qpid::messaging::TargetCapacityExceeded & ex) {
+ pExceptionType = pTargetCapacityExceeded;
+ error = ex.what();
+ } catch (qpid::messaging::NotFound & ex) {
+ pExceptionType = pNotFound;
+ error = ex.what();
+ } catch (qpid::messaging::TransportFailure & ex) {
+ pExceptionType = pTransportFailure;
+ error = ex.what();
} catch (qpid::types::Exception& ex) {
+ pExceptionType = PyExc_RuntimeError;
error = ex.what();
}
Py_END_ALLOW_THREADS;
if (!error.empty()) {
- PyErr_SetString(PyExc_RuntimeError, error.c_str());
+ PyErr_SetString(pExceptionType, error.c_str());
return NULL;
}
}
+
+/* This only renames the non-const version (I believe). Then again, I
+ * don't even know why there is a non-const version of the method. */
+%rename(opened) qpid::messaging::Connection::isOpen();
+%rename(receiver) qpid::messaging::Session::createReceiver;
+%rename(sender) qpid::messaging::Session::createSender;
+%rename(_acknowledge_all) qpid::messaging::Session::acknowledge(bool);
+%rename(_acknowledge_msg) qpid::messaging::Session::acknowledge(
+ Message &, bool);
+
+%rename(_fetch) qpid::messaging::Receiver::fetch;
+%rename(unsettled) qpid::messaging::Receiver::getUnsettled;
+%rename(available) qpid::messaging::Receiver::getAvailable;
+
+%rename(unsettled) qpid::messaging::Sender::getUnsettled;
+%rename(available) qpid::messaging::Sender::getAvailable;
+%rename(_send) qpid::messaging::Sender::send;
+
+%rename(_getReplyTo) qpid::messaging::Message::getReplyTo;
+%rename(_setReplyTo) qpid::messaging::Message::setReplyTo;
+%rename(_getTtl) qpid::messaging::Message::getTtl;
+%rename(_setTtl) qpid::messaging::Message::setTtl;
+
+
%include "../qpid.i"
+%extend qpid::messaging::Connection {
+ %pythoncode %{
+ # Handle the different options by converting underscores to hyphens.
+ # Also, the sasl_mechanisms option in Python has no direct
+ # equivalent in C++, so we will translate them to sasl_mechanism
+ # when possible.
+ def __init__(self, url=None, **options):
+ args = [url] if url else []
+ if options :
+ if "sasl_mechanisms" in options :
+ if ' ' in options.get("sasl_mechanisms",'') :
+ raise Exception(
+ "C++ Connection objects are unable to handle "
+ "multiple sasl-mechanisms")
+ options["sasl_mechanism"] = options.pop("sasl_mechanisms")
+ args.append(options)
+ this = _cqpid.new_Connection(*args)
+ try: self.this.append(this)
+ except: self.this = this
+ %}
+
+ /* Return a pre-existing session with the given name, if one
+ * exists, otherwise return a new one. (Note that if a
+ * pre-existing session exists, the transactional argument is
+ * ignored, and the returned session might not satisfy the desired
+ * setting. */
+ qpid::messaging::Session _session(const std::string & name,
+ bool transactional) {
+ if (!name.empty()) {
+ try {
+ return self->getSession(name);
+ }
+ catch (const qpid::messaging::KeyError &) {
+ }
+ }
+ if (transactional) {
+ return self->createTransactionalSession(name);
+ }
+ else {
+ return self->createSession(name);
+ }
+ }
+
+ %pythoncode %{
+ def session(self, name=None, transactional=False) :
+ if name is None :
+ name = ''
+ return self._session(name, transactional)
+ %}
+
+ %pythoncode %{
+ @staticmethod
+ def establish(url=None, **options) :
+ conn = Connection(url, **options)
+ conn.open()
+ return conn
+ %}
+}
+
+%extend qpid::messaging::Session {
+ %pythoncode %{
+ def acknowledge(self, message=None, disposition=None, sync=True) :
+ if disposition :
+ raise Exception("SWIG does not support dispositions yet. Use "
+ "Session.reject and Session.release instead")
+ if message :
+ self._acknowledge_msg(message, sync)
+ else :
+ self._acknowledge_all(sync)
+
+ __swig_getmethods__["connection"] = getConnection
+ if _newclass: connection = _swig_property(getConnection)
+ %}
+}
+
+
+%extend qpid::messaging::Receiver {
+ %pythoncode %{
+ __swig_getmethods__["capacity"] = getCapacity
+ __swig_setmethods__["capacity"] = setCapacity
+ if _newclass: capacity = _swig_property(getCapacity, setCapacity)
+
+ __swig_getmethods__["session"] = getSession
+ if _newclass: session = _swig_property(getSession)
+ %}
+
+ %pythoncode %{
+ def fetch(self, timeout=None) :
+ if timeout is None :
+ return self._fetch()
+ else :
+ # Python API uses timeouts in seconds,
+ # but C++ API uses milliseconds
+ return self._fetch(Duration(int(1000*timeout)))
+ %}
+}
+
+%extend qpid::messaging::Sender {
+ %pythoncode %{
+ def send(self, object, sync=True) :
+ if isinstance(object, Message):
+ message = object
+ else:
+ message = Message(object)
+ return self._send(message, sync)
+
+ __swig_getmethods__["capacity"] = getCapacity
+ __swig_setmethods__["capacity"] = setCapacity
+ if _newclass: capacity = _swig_property(getCapacity, setCapacity)
+
+ __swig_getmethods__["session"] = getSession
+ if _newclass: session = _swig_property(getSession)
+ %}
+}
+
+
+%extend qpid::messaging::Message {
+ %pythoncode %{
+ # UNSPECIFIED was module level before, but I do not
+ # know how to insert python code at the top of the module.
+ # (A bare "%pythoncode" inserts at the end.
+ UNSPECIFIED=object()
+ def __init__(self, content=None, content_type=UNSPECIFIED, id=None,
+ subject=None, user_id=None, reply_to=None,
+ correlation_id=None, durable=None, priority=None,
+ ttl=None, properties=None):
+ this = _cqpid.new_Message('')
+ try: self.this.append(this)
+ except: self.this = this
+ if content :
+ self.content = content
+ if content_type != UNSPECIFIED :
+ self.content_type = content_type
+ if id is not None :
+ self.id = id
+ if subject is not None :
+ self.subject = subject
+ if user_id is not None :
+ self.user_id = user_id
+ if reply_to is not None :
+ self.reply_to = reply_to
+ if correlation_id is not None :
+ self.correlation_id = correlation_id
+ if durable is not None :
+ self.durable = durable
+ if priority is not None :
+ self.priority = priority
+ if ttl is not None :
+ self.ttl = ttl
+ if properties is not None :
+ # Can't set properties via (inst).getProperties, because
+ # the typemaps make a copy of the underlying properties.
+ # Instead, set via setProperty for the time-being
+ for k, v in properties.iteritems() :
+ self.setProperty(k, v)
+
+ def _get_content(self) :
+ if self.content_type == "amqp/list" :
+ return decodeList(self)
+ if self.content_type == "amqp/map" :
+ return decodeMap(self)
+ return self.getContent()
+ def _set_content(self, content) :
+ if isinstance(content, basestring) :
+ self.setContent(content)
+ elif isinstance(content, list) or isinstance(content, dict) :
+ encode(content, self)
+ else :
+ # Not a type we can handle. Try setting it anyway,
+ # although this will probably lead to a swig error
+ self.setContent(content)
+ __swig_getmethods__["content"] = _get_content
+ __swig_setmethods__["content"] = _set_content
+ if _newclass: content = _swig_property(_get_content, _set_content)
+
+ __swig_getmethods__["content_type"] = getContentType
+ __swig_setmethods__["content_type"] = setContentType
+ if _newclass: content_type = _swig_property(getContentType,
+ setContentType)
+
+ __swig_getmethods__["id"] = getMessageId
+ __swig_setmethods__["id"] = setMessageId
+ if _newclass: id = _swig_property(getMessageId, setMessageId)
+
+ __swig_getmethods__["subject"] = getSubject
+ __swig_setmethods__["subject"] = setSubject
+ if _newclass: subject = _swig_property(getSubject, setSubject)
+
+ __swig_getmethods__["priority"] = getPriority
+ __swig_setmethods__["priority"] = setPriority
+ if _newclass: priority = _swig_property(getPriority, setPriority)
+
+ def getTtl(self) :
+ return self._getTtl().getMilliseconds()/1000.0
+ def setTtl(self, duration) :
+ self._setTtl(Duration(int(1000*duration)))
+ __swig_getmethods__["ttl"] = getTtl
+ __swig_setmethods__["ttl"] = setTtl
+ if _newclass: ttl = _swig_property(getTtl, setTtl)
+
+ __swig_getmethods__["user_id"] = getUserId
+ __swig_setmethods__["user_id"] = setUserId
+ if _newclass: user_id = _swig_property(getUserId, setUserId)
+
+ __swig_getmethods__["correlation_id"] = getCorrelationId
+ __swig_setmethods__["correlation_id"] = setCorrelationId
+ if _newclass: correlation_id = _swig_property(getCorrelationId,
+ setCorrelationId)
+
+ __swig_getmethods__["redelivered"] = getRedelivered
+ __swig_setmethods__["redelivered"] = setRedelivered
+ if _newclass: redelivered = _swig_property(getRedelivered,
+ setRedelivered)
+
+ __swig_getmethods__["durable"] = getDurable
+ __swig_setmethods__["durable"] = setDurable
+ if _newclass: durable = _swig_property(getDurable, setDurable)
+
+ __swig_getmethods__["properties"] = getProperties
+ if _newclass: properties = _swig_property(getProperties)
+
+ def getReplyTo(self) :
+ return self._getReplyTo().str()
+ def setReplyTo(self, address_str) :
+ self._setReplyTo(Address(address_str))
+ __swig_getmethods__["reply_to"] = getReplyTo
+ __swig_setmethods__["reply_to"] = setReplyTo
+ if _newclass: reply_to = _swig_property(getReplyTo, setReplyTo)
+
+ def __repr__(self):
+ args = []
+ for name in ["id", "subject", "user_id", "reply_to",
+ "correlation_id", "priority", "ttl",
+ "durable", "redelivered", "properties",
+ "content_type"] :
+ value = getattr(self, name)
+ if value : args.append("%s=%r" % (name, value))
+ if self.content is not None:
+ if args:
+ args.append("content=%r" % self.content)
+ else:
+ args.append(repr(self.content))
+ return "Message(%s)" % ", ".join(args)
+ %}
+}
+
+%pythoncode %{
+# Bring into module scope
+UNSPECIFIED = Message.UNSPECIFIED
+%}
Copied: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/ruby/lib/qpid/message.rb (from r1156187, qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid/message.rb)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/ruby/lib/qpid/message.rb?p2=qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/ruby/lib/qpid/message.rb&p1=qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid/message.rb&r1=1156187&r2=1172657&rev=1172657&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/lib/qpid/message.rb (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/ruby/lib/qpid/message.rb Mon Sep 19 15:13:18 2011
@@ -30,6 +30,7 @@ module Qpid
@message_impl = message_impl
@message_impl = Cqpid::Message.new if @message_impl.nil?
@message_impl.setContent args[:content].to_s if args[:content]
+ @content = nil
end
def message_impl # :nodoc:
@@ -113,10 +114,37 @@ module Qpid
def []=(key, value); @message_impl.setProperty(key.to_s, value.to_s); end
# Sets the content.
- def content=(content); @message_impl.setContent content.to_s; end
+ def content=(content)
+ content_type = nil
+ @content = content
+ case @content
+ when Hash
+ content_type = "amqp/map"
+ when Array
+ content_type = "amqp/list"
+ end
+ if content_type.nil?
+ @message_impl.setContent @content
+ else
+ Qpid::Messaging.encode @content, self, content_type
+ end
+ end
# Returns the content.
- def content; @message_impl.getContent; end
+ def content
+ if @content.nil?
+ @content = @message_impl.getContent
+
+ # decode the content is necessary if it
+ # has an encoded content type
+ if ["amqp/list", "amqp/map"].include? @message_impl.getContentType
+ @content = Qpid::Messaging.decode(self,
+ @message_impl.getContentType)
+ end
+
+ end
+ @content
+ end
# Returns the content's size.
def content_size; @message_impl.getContentSize; end
Copied: qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/ruby/test/test_message.rb (from r1156187, qpid/trunk/qpid/cpp/bindings/qpid/ruby/test/test_message.rb)
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/ruby/test/test_message.rb?p2=qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/ruby/test/test_message.rb&p1=qpid/trunk/qpid/cpp/bindings/qpid/ruby/test/test_message.rb&r1=1156187&r2=1172657&rev=1172657&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/bindings/qpid/ruby/test/test_message.rb (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/qpid/ruby/test/test_message.rb Mon Sep 19 15:13:18 2011
@@ -22,8 +22,7 @@ $:.unshift File.join(File.dirname(__FILE
require 'test/unit'
require 'flexmock/test_unit'
-require 'qpid/encoding'
-require 'qpid/message'
+require 'qpid'
class TestMessage < Test::Unit::TestCase
@@ -31,6 +30,7 @@ class TestMessage < Test::Unit::TestCase
@address = flexmock("address")
@address_impl = flexmock("address_impl")
+ @messaging = flexmock(Qpid::Messaging)
@message_impl = flexmock("message")
@message = Qpid::Messaging::Message.new({}, @message_impl)
end
@@ -283,17 +283,63 @@ class TestMessage < Test::Unit::TestCase
with("foo")
@message.content = "foo"
+ assert_equal "foo", @message.content
+ end
+
+ def test_set_content_with_array
+ content = ["one", "two", "three"]
+
+ @messaging.
+ should_receive(:encode).
+ once.
+ with(content, @message, "amqp/list")
+
+ @message.content = content
+ assert_same content, @message.content
+ end
+
+ def test_set_content_with_map
+ content = {:foo => "bar", :dog => "cat"}
+
+ @messaging.
+ should_receive(:encode).
+ once.
+ with(content, @message, "amqp/map")
+
+ @message.content = content
+ assert_same content, @message.content
end
def test_get_content
@message_impl.
should_receive(:getContent).
- once.
and_return("foo")
+ @message_impl.
+ should_receive(:getContentType).
+ and_return(String)
assert_equal "foo", @message.content
end
+ def test_get_content_with_array
+ decoded = ["foo", "bar"]
+
+ @message_impl.
+ should_receive(:getContent).
+ and_return("[foo,bar]")
+ @message_impl.
+ should_receive(:getContentType).
+ and_return("amqp/list")
+ @messaging.
+ should_receive(:decode).
+ once.
+ with(@message, "amqp/list").
+ and_return(decoded)
+
+ result = @message.content
+ assert_same decoded, result
+ end
+
def test_get_content_size
@message_impl.
should_receive(:getContentSize).
Modified: qpid/branches/qpid-3346/qpid/cpp/bindings/swig_python_typemaps.i
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/bindings/swig_python_typemaps.i?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/bindings/swig_python_typemaps.i (original)
+++ qpid/branches/qpid-3346/qpid/cpp/bindings/swig_python_typemaps.i Mon Sep 19 15:13:18 2011
@@ -17,6 +17,25 @@
* under the License.
*/
+/* For UUID objects, to convert them to Python uuid.UUID objects,
+ * we'll need a reference to the uuid module.
+ */
+%{
+static PyObject* pUuidModule;
+%}
+
+%init %{
+ pUuidModule = PyImport_ImportModule("uuid");
+
+ /* Although it is not required, we'll publish the uuid module in our
+ * module, as if this module was a python module and we called
+ * "import uuid"
+ */
+ Py_INCREF(pUuidModule);
+ PyModule_AddObject(m, "uuid", pUuidModule);
+%}
+
+
%wrapper %{
#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
@@ -28,6 +47,7 @@ typedef int Py_ssize_t;
PyObject* MapToPy(const qpid::types::Variant::Map*);
PyObject* ListToPy(const qpid::types::Variant::List*);
+ PyObject* UuidToPy(const qpid::types::Uuid*);
void PyToMap(PyObject*, qpid::types::Variant::Map*);
void PyToList(PyObject*, qpid::types::Variant::List*);
@@ -104,6 +124,9 @@ typedef int Py_ssize_t;
break;
}
case qpid::types::VAR_UUID : {
+ qpid::types::Uuid uuid = v->asUuid();
+ result = UuidToPy(&uuid);
+ break;
}
}
} catch (qpid::types::Exception& ex) {
@@ -143,6 +166,30 @@ typedef int Py_ssize_t;
return result;
}
+ PyObject* UuidToPy(const qpid::types::Uuid * uuid) {
+ PyObject* pUuidClass = PyObject_GetAttrString(pUuidModule, "UUID");
+ if (!pUuidClass) {
+ // Failed to get UUID class
+ return 0;
+ }
+
+ PyObject* pArgs = PyTuple_New(0);
+ PyObject* pKw = PyDict_New();
+ PyObject* pData = PyString_FromStringAndSize(
+ (const char*)(uuid->data()), 16);
+ PyDict_SetItemString(pKw, "bytes", pData);
+
+ PyObject* result = PyObject_Call(pUuidClass, pArgs, pKw);
+
+ Py_DECREF(pData);
+ Py_DECREF(pKw);
+ Py_DECREF(pArgs);
+ Py_DECREF(pUuidClass);
+
+ return result;
+ }
+
+
void PyToMap(PyObject* obj, qpid::types::Variant::Map* map) {
map->clear();
Py_ssize_t iter(0);
@@ -304,6 +351,15 @@ typedef int Py_ssize_t;
Py_INCREF($result);
}
+/*
+ * UUID type: C++ --> Python
+ */
+%typemap(out) qpid::types::UUID & {
+ $result = UuidToPy($1);
+ if ($result)
+ Py_INCREF($result);
+}
+
/*
* Variant types: Ruby --> C++
Propchange: qpid/branches/qpid-3346/qpid/cpp/docs/api/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -4,4 +4,4 @@
/qpid/branches/0.6-release-windows-installer/qpid/cpp/docs/api:926803,927233
/qpid/branches/java-network-refactor/qpid/cpp/docs/api:805429-825319
/qpid/branches/qpid-2935/qpid/cpp/docs/api:1061302-1072333
-/qpid/trunk/qpid/cpp/docs/api:1156188
+/qpid/trunk/qpid/cpp/docs/api:1144319-1172654
Modified: qpid/branches/qpid-3346/qpid/cpp/docs/api/doxygen_mainpage.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/docs/api/doxygen_mainpage.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/docs/api/doxygen_mainpage.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/docs/api/doxygen_mainpage.h Mon Sep 19 15:13:18 2011
@@ -266,7 +266,46 @@
* else
* session.rollback();
* </pre>
- *
+ *
+ * <h3>Exceptions</h3>
+ *
+ * All exceptions for the messaging API have MessagingException as
+ * their base class.
+
+ * A common class of exception are those related to processing
+ * addresses used to create senders and/or receivers. These all have
+ * AddressError as their base class.
+ *
+ * Where there is a syntax error in the address itself, a
+ * MalformedAddress will be thrown. Where the address is valid, but
+ * there is an error in interpreting (i.e. resolving) it, a
+ * ResolutionError - or a sub-class of it - will be thrown. If the
+ * address has assertions enabled for a given context and the asserted
+ * node properties are not in fact correct then AssertionFailed will
+ * be thrown. If the node is not found, NotFound will be thrown.
+ *
+ * The loss of the underlying connection (e.g. the TCP connection)
+ * results in TransportFailure being thrown. If automatic reconnect is
+ * enabled, this will be caught be the library which will then try to
+ * reconnect. If reconnection - as configured by the connection
+ * options - fails, then TransportFailure will be thrown. This can
+ * occur on any call to the messaging API.
+ *
+ * Sending a message may also result in an exception
+ * (e.g. TargetCapacityExceeded if a queue to which the message is
+ * delivered cannot enqueue it due to lack of capacity). For
+ * asynchronous send the exception may not be thrown on the send
+ * invocation that actually triggers it, but on a subsequent method
+ * call on the API.
+ *
+ * Certain exceptions may render the session invalid; once these
+ * occur, subsequent calls on the session will throw the same class of
+ * exception. This is not an intrinsic property of the class of
+ * exception, but is a result of the current mapping of the API to the
+ * underlying AMQP 0-10 protocol. You can test whether the session is
+ * valid at any time using the hasError() and/or checkError() methods
+ * on Session.
+ *
* <h3>Logging</h3>
*
* The Qpidd broker and C++ clients can both use environment variables to
Modified: qpid/branches/qpid-3346/qpid/cpp/examples/messaging/drain.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/examples/messaging/drain.cpp?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/examples/messaging/drain.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/examples/messaging/drain.cpp Mon Sep 19 15:13:18 2011
@@ -45,7 +45,7 @@ struct Options : OptionParser
url("127.0.0.1"),
timeout(0),
forever(false),
- count(1)
+ count(0)
{
add("broker,b", url, "url of broker to connect to");
add("timeout,t", timeout, "timeout in seconds to wait before exiting");
Propchange: qpid/branches/qpid-3346/qpid/cpp/examples/old_api/tradedemo/tradedemo_topic_publisher.vcproj
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -3,4 +3,4 @@
/qpid/branches/0.6-release-windows-installer/qpid/cpp/examples/tradedemo/tradedemo_topic_publisher.vcproj:926803,927218,927233
/qpid/branches/java-network-refactor/qpid/cpp/examples/tradedemo/tradedemo_topic_publisher.vcproj:805429-825319
/qpid/branches/qpid-2935/qpid/cpp/examples/tradedemo/tradedemo_topic_publisher.vcproj:1061302-1072333
-/qpid/trunk/qpid/cpp/examples/old_api/tradedemo/tradedemo_topic_publisher.vcproj:1156188
+/qpid/trunk/qpid/cpp/examples/old_api/tradedemo/tradedemo_topic_publisher.vcproj:1144319-1172654
Modified: qpid/branches/qpid-3346/qpid/cpp/include/qmf/AgentSession.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/include/qmf/AgentSession.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/include/qmf/AgentSession.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/include/qmf/AgentSession.h Mon Sep 19 15:13:18 2011
@@ -71,6 +71,11 @@ namespace qmf {
* If False: Listen only on the routable direct address
* strict-security:{True,False} - If True: Cooperate with the broker to enforce strict access control to the network
* - If False: Operate more flexibly with regard to use of messaging facilities [default]
+ * max-thread-wait-time:N - Time (in seconds) the session thread will wait for messages from the network between
+ * periodic background processing passes. [default: 5]
+ * Must not be greater than 'interval'. Larger numbers will cause fewer wake-ups but will
+ * increase the time it takes to shut down the process. This setting will not affect the
+ * agent's response time for queries or method invocation.
*/
QMF_EXTERN AgentSession(qpid::messaging::Connection& conn, const std::string& options="");
@@ -183,6 +188,7 @@ namespace qmf {
#ifndef SWIG
private:
friend class qmf::PrivateImplRef<AgentSession>;
+ friend struct AgentSessionImplAccess;
#endif
};
Modified: qpid/branches/qpid-3346/qpid/cpp/include/qmf/ConsoleSession.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/include/qmf/ConsoleSession.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/include/qmf/ConsoleSession.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/include/qmf/ConsoleSession.h Mon Sep 19 15:13:18 2011
@@ -61,6 +61,10 @@ namespace qmf {
* If False: Listen only on the routable direct address
* strict-security:{True,False} - If True: Cooperate with the broker to enforce strict access control to the network
* - If False: Operate more flexibly with regard to use of messaging facilities [default]
+ * max-thread-wait-time:N - Time (in seconds) the session thread will wait for messages from the network between
+ * periodic background processing passes.
+ * Must not be greater than 60. Larger numbers will cause fewer wake-ups but will
+ * increase the time it takes to shut down the process. [default: 5]
*/
QMF_EXTERN ConsoleSession(qpid::messaging::Connection& conn, const std::string& options="");
@@ -119,6 +123,7 @@ namespace qmf {
#ifndef SWIG
private:
friend class qmf::PrivateImplRef<ConsoleSession>;
+ friend struct ConsoleSessionImplAccess;
#endif
};
Modified: qpid/branches/qpid-3346/qpid/cpp/include/qmf/DataAddr.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/include/qmf/DataAddr.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/include/qmf/DataAddr.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/include/qmf/DataAddr.h Mon Sep 19 15:13:18 2011
@@ -51,6 +51,9 @@ namespace qmf {
QMF_EXTERN uint32_t getAgentEpoch() const;
QMF_EXTERN qpid::types::Variant::Map asMap() const;
+ QMF_EXTERN bool operator==(const DataAddr&) const;
+ QMF_EXTERN bool operator<(const DataAddr&) const;
+
#ifndef SWIG
private:
friend class qmf::PrivateImplRef<DataAddr>;
Propchange: qpid/branches/qpid-3346/qpid/cpp/include/qmf/engine/Agent.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -1,2 +1,2 @@
/qpid/branches/qpid-2935/qpid/cpp/include/qmf/engine/Agent.h:1061302-1072333
-/qpid/trunk/qpid/cpp/include/qmf/engine/Agent.h:1156188
+/qpid/trunk/qpid/cpp/include/qmf/engine/Agent.h:1144319-1172654
Propchange: qpid/branches/qpid-3346/qpid/cpp/include/qmf/engine/Console.h
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -1,2 +1,2 @@
/qpid/branches/qpid-2935/qpid/cpp/include/qmf/engine/Console.h:1061302-1072333
-/qpid/trunk/qpid/cpp/include/qmf/engine/Console.h:1156188
+/qpid/trunk/qpid/cpp/include/qmf/engine/Console.h:1144319-1172654
Modified: qpid/branches/qpid-3346/qpid/cpp/include/qpid/Msg.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/include/qpid/Msg.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/include/qpid/Msg.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/include/qpid/Msg.h Mon Sep 19 15:13:18 2011
@@ -24,6 +24,7 @@
#include <sstream>
#include <iostream>
+#include "qpid/types/ImportExport.h"
namespace qpid {
Modified: qpid/branches/qpid-3346/qpid/cpp/include/qpid/framing/FieldTable.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/include/qpid/framing/FieldTable.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/include/qpid/framing/FieldTable.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/include/qpid/framing/FieldTable.h Mon Sep 19 15:13:18 2011
@@ -65,8 +65,8 @@ class FieldTable
QPID_COMMON_EXTERN void decode(Buffer& buffer);
QPID_COMMON_EXTERN int count() const;
- QPID_COMMON_EXTERN size_t size() const { return values.size(); }
- QPID_COMMON_EXTERN bool empty() { return size() == 0; }
+ QPID_COMMON_INLINE_EXTERN size_t size() const { return values.size(); }
+ QPID_COMMON_INLINE_EXTERN bool empty() { return size() == 0; }
QPID_COMMON_EXTERN void set(const std::string& name, const ValuePtr& value);
QPID_COMMON_EXTERN ValuePtr get(const std::string& name) const;
QPID_COMMON_INLINE_EXTERN bool isSet(const std::string& name) const { return get(name).get() != 0; }
Modified: qpid/branches/qpid-3346/qpid/cpp/include/qpid/framing/List.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/include/qpid/framing/List.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/include/qpid/framing/List.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/include/qpid/framing/List.h Mon Sep 19 15:13:18 2011
@@ -40,6 +40,7 @@ class QPID_COMMON_CLASS_EXTERN List
{
public:
typedef boost::shared_ptr<FieldValue> ValuePtr;
+ typedef ValuePtr value_type;
typedef std::list<ValuePtr> Values;
typedef Values::const_iterator const_iterator;
typedef Values::iterator iterator;
Modified: qpid/branches/qpid-3346/qpid/cpp/include/qpid/messaging/Session.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/include/qpid/messaging/Session.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/include/qpid/messaging/Session.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/include/qpid/messaging/Session.h Mon Sep 19 15:13:18 2011
@@ -62,6 +62,12 @@ class QPID_MESSAGING_CLASS_EXTERN Sessio
*/
QPID_MESSAGING_EXTERN void close();
+ /**
+ * Commits the sessions transaction.
+ *
+ * @exception TransactionAborted if the original session is lost
+ * forcing an automatic rollback.
+ */
QPID_MESSAGING_EXTERN void commit();
QPID_MESSAGING_EXTERN void rollback();
@@ -139,25 +145,51 @@ class QPID_MESSAGING_CLASS_EXTERN Sessio
/**
* Create a new sender through which messages can be sent to the
* specified address.
+ *
+ * @exception ResolutionError if there is an error in resolving
+ * the address
*/
QPID_MESSAGING_EXTERN Sender createSender(const Address& address);
+ /**
+ * Create a new sender through which messages can be sent to the
+ * specified address.
+ *
+ * @exception ResolutionError if there is an error in resolving
+ * the address
+ *
+ * @exception MalformedAddress if the syntax of address is not
+ * valid
+ */
QPID_MESSAGING_EXTERN Sender createSender(const std::string& address);
/**
* Create a new receiver through which messages can be received
* from the specified address.
+ *
+ * @exception ResolutionError if there is an error in resolving
+ * the address
*/
QPID_MESSAGING_EXTERN Receiver createReceiver(const Address& address);
+ /**
+ * Create a new receiver through which messages can be received
+ * from the specified address.
+ *
+ * @exception ResolutionError if there is an error in resolving
+ * the address
+ *
+ * @exception MalformedAddress if the syntax of address is not
+ * valid
+ */
QPID_MESSAGING_EXTERN Receiver createReceiver(const std::string& address);
/**
* Returns the sender with the specified name.
- *@exception KeyError if there is none for that name.
+ * @exception KeyError if there is none for that name.
*/
QPID_MESSAGING_EXTERN Sender getSender(const std::string& name) const;
/**
* Returns the receiver with the specified name.
- *@exception KeyError if there is none for that name.
+ * @exception KeyError if there is none for that name.
*/
QPID_MESSAGING_EXTERN Receiver getReceiver(const std::string& name) const;
/**
@@ -166,7 +198,16 @@ class QPID_MESSAGING_CLASS_EXTERN Sessio
*/
QPID_MESSAGING_EXTERN Connection getConnection() const;
+ /**
+ * @returns true if the session has been rendered invalid by some
+ * exception, false if it is valid for use.
+ */
QPID_MESSAGING_EXTERN bool hasError();
+ /**
+ * If the session has been rendered invalid by some exception,
+ * this method will result in that exception being thrown on
+ * calling this method.
+ */
QPID_MESSAGING_EXTERN void checkError();
#ifndef SWIG
Modified: qpid/branches/qpid-3346/qpid/cpp/include/qpid/messaging/exceptions.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/include/qpid/messaging/exceptions.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/include/qpid/messaging/exceptions.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/include/qpid/messaging/exceptions.h Mon Sep 19 15:13:18 2011
@@ -10,9 +10,9 @@
* 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
@@ -29,23 +29,36 @@
namespace qpid {
namespace messaging {
-/** \ingroup messaging
+/** \ingroup messaging
*/
-struct QPID_MESSAGING_CLASS_EXTERN MessagingException : public qpid::types::Exception
+/**
+ * This is the base class for all messaging related exceptions thrown
+ * by this API.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN MessagingException : public qpid::types::Exception
{
QPID_MESSAGING_EXTERN MessagingException(const std::string& msg);
QPID_MESSAGING_EXTERN virtual ~MessagingException() throw();
-
+
qpid::types::Variant::Map detail;
//TODO: override what() to include detail if present
};
-struct QPID_MESSAGING_CLASS_EXTERN InvalidOptionString : public MessagingException
+/**
+ * Thrown when the syntax of the option string used to configure a
+ * connection in not valid
+ */
+struct QPID_MESSAGING_CLASS_EXTERN InvalidOptionString : public MessagingException
{
QPID_MESSAGING_EXTERN InvalidOptionString(const std::string& msg);
};
+/**
+ * Thrown to indicate a failed lookup of some local object. For
+ * example when attempting to retrieve a session, sender or receiver
+ * by name.
+ */
struct QPID_MESSAGING_CLASS_EXTERN KeyError : public MessagingException
{
QPID_MESSAGING_EXTERN KeyError(const std::string&);
@@ -65,25 +78,33 @@ struct QPID_MESSAGING_CLASS_EXTERN Addre
* Thrown when a syntactically correct address cannot be resolved or
* used.
*/
-struct QPID_MESSAGING_CLASS_EXTERN ResolutionError : public AddressError
+struct QPID_MESSAGING_CLASS_EXTERN ResolutionError : public AddressError
{
QPID_MESSAGING_EXTERN ResolutionError(const std::string& msg);
};
-struct QPID_MESSAGING_CLASS_EXTERN AssertionFailed : public ResolutionError
+/**
+ * Thrown when creating a sender or receiver for an address for which
+ * some asserted property of the node is not matched.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN AssertionFailed : public ResolutionError
{
QPID_MESSAGING_EXTERN AssertionFailed(const std::string& msg);
};
-struct QPID_MESSAGING_CLASS_EXTERN NotFound : public ResolutionError
+/**
+ * Thrown on attempts to create a sender or receiver to a non-existent
+ * node.
+ */
+struct QPID_MESSAGING_CLASS_EXTERN NotFound : public ResolutionError
{
QPID_MESSAGING_EXTERN NotFound(const std::string& msg);
};
/**
- * Thrown when an address string with inalid sytanx is used.
+ * Thrown when an address string with invalid syntax is used.
*/
-struct QPID_MESSAGING_CLASS_EXTERN MalformedAddress : public AddressError
+struct QPID_MESSAGING_CLASS_EXTERN MalformedAddress : public AddressError
{
QPID_MESSAGING_EXTERN MalformedAddress(const std::string& msg);
};
@@ -98,6 +119,11 @@ struct QPID_MESSAGING_CLASS_EXTERN Fetch
QPID_MESSAGING_EXTERN FetchError(const std::string&);
};
+/**
+ * Thrown by Receiver::fetch(), Receiver::get() and
+ * Session::nextReceiver() to indicate that there no message was
+ * available before the timeout specified.
+ */
struct QPID_MESSAGING_CLASS_EXTERN NoMessageAvailable : public FetchError
{
QPID_MESSAGING_EXTERN NoMessageAvailable();
@@ -113,6 +139,11 @@ struct QPID_MESSAGING_CLASS_EXTERN SendE
QPID_MESSAGING_EXTERN SendError(const std::string&);
};
+/**
+ * Thrown to indicate that the sender attempted to send a message that
+ * would result in the target node on the peer exceeding a
+ * preconfigured capacity.
+ */
struct QPID_MESSAGING_CLASS_EXTERN TargetCapacityExceeded : public SendError
{
QPID_MESSAGING_EXTERN TargetCapacityExceeded(const std::string&);
@@ -128,11 +159,19 @@ struct QPID_MESSAGING_CLASS_EXTERN Trans
QPID_MESSAGING_EXTERN TransactionError(const std::string&);
};
+/**
+ * Thrown on Session::commit() if reconnection results in the
+ * transaction being automatically aborted.
+ */
struct QPID_MESSAGING_CLASS_EXTERN TransactionAborted : public TransactionError
{
QPID_MESSAGING_EXTERN TransactionAborted(const std::string&);
};
+/**
+ * Thrown to indicate that the application attempted to do something
+ * for which it was not authorised by its peer.
+ */
struct QPID_MESSAGING_CLASS_EXTERN UnauthorizedAccess : public SessionError
{
QPID_MESSAGING_EXTERN UnauthorizedAccess(const std::string&);
@@ -143,6 +182,13 @@ struct QPID_MESSAGING_CLASS_EXTERN Conne
QPID_MESSAGING_EXTERN ConnectionError(const std::string&);
};
+/**
+ * Thrown to indicate loss of underlying connection. When
+ * auto-reconnect is used this will be caught by the library and used
+ * to trigger reconnection attempts. If reconnection fails (according
+ * to whatever settings have been configured), then an instnace of
+ * this class will be thrown to signal that.
+ */
struct QPID_MESSAGING_CLASS_EXTERN TransportFailure : public MessagingException
{
QPID_MESSAGING_EXTERN TransportFailure(const std::string&);
Modified: qpid/branches/qpid-3346/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/include/qpid/sys/windows/IntegerTypes.h Mon Sep 19 15:13:18 2011
@@ -27,7 +27,7 @@ typedef short int16_t;
typedef unsigned int uint32_t;
typedef int int32_t;
#if defined(_MSC_VER)
-typedef char int8_t;
+typedef signed char int8_t;
typedef unsigned __int64 uint64_t;
typedef __int64 int64_t;
#else
Modified: qpid/branches/qpid-3346/qpid/cpp/managementgen/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/managementgen/Makefile.am?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/managementgen/Makefile.am (original)
+++ qpid/branches/qpid-3346/qpid/cpp/managementgen/Makefile.am Mon Sep 19 15:13:18 2011
@@ -32,6 +32,7 @@ pkgpyexec_qmfgentmpl_PYTHON = \
qmfgen/templates/Args.h \
qmfgen/templates/Class.cpp \
qmfgen/templates/Class.h \
+ qmfgen/templates/CMakeLists.cmake \
qmfgen/templates/Event.cpp \
qmfgen/templates/Event.h \
qmfgen/templates/Makefile.mk \
Modified: qpid/branches/qpid-3346/qpid/cpp/rubygen/amqpgen.rb
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/rubygen/amqpgen.rb?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/rubygen/amqpgen.rb (original)
+++ qpid/branches/qpid-3346/qpid/cpp/rubygen/amqpgen.rb Mon Sep 19 15:13:18 2011
@@ -191,7 +191,8 @@ class AmqpElement
"command-fragments" => "session.command-fragment",
"in-doubt" => "dtx.xid",
"tx-publish" => "str-8",
- "queues" => "str-8"
+ "queues" => "str-8",
+ "prepared" => "str-8"
}
def array_type(name)
Modified: qpid/branches/qpid-3346/qpid/cpp/src/CMakeLists.txt
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/CMakeLists.txt?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/CMakeLists.txt (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/CMakeLists.txt Mon Sep 19 15:13:18 2011
@@ -580,6 +580,15 @@ include (ssl.cmake)
check_symbol_exists (LOG_AUTHPRIV "sys/syslog.h" HAVE_LOG_AUTHPRIV)
check_symbol_exists (LOG_FTP "sys/syslog.h" HAVE_LOG_FTP)
+# Allow MSVC user to select 'WinXP-SP3/Windows Server 2003' as build target version
+set (win32_winnt_default OFF)
+if (CMAKE_SYSTEM_NAME STREQUAL Windows)
+ if (MSVC)
+ set (win32_winnt_default ON)
+ endif (MSVC)
+endif (CMAKE_SYSTEM_NAME STREQUAL Windows)
+option(SET_WIN32_WINNT "In Windows-MSVC build: define _WIN32_WINNT=0x0502 to select target version: Windows XP with SP3" ${win32_winnt_default})
+
if (CMAKE_SYSTEM_NAME STREQUAL Windows)
if (MSVC)
add_definitions(
@@ -590,9 +599,9 @@ if (CMAKE_SYSTEM_NAME STREQUAL Windows)
/wd4800
/wd4355
)
- if (MSVC80)
- add_definitions(/D "_WIN32_WINNT=0x0501")
- endif (MSVC80)
+ if (SET_WIN32_WINNT)
+ add_definitions(/D "_WIN32_WINNT=0x0502")
+ endif (SET_WIN32_WINNT)
# set the RelWithDebInfo compile/link switches to equal Release
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MD /O2 /Ob2 /D NDEBUG")
@@ -914,8 +923,6 @@ set (qpidmessaging_SOURCES
qpid/client/amqp0_10/SessionImpl.cpp
qpid/client/amqp0_10/SenderImpl.h
qpid/client/amqp0_10/SenderImpl.cpp
- qpid/client/amqp0_10/SimpleUrlParser.h
- qpid/client/amqp0_10/SimpleUrlParser.cpp
)
add_msvc_version (qpidmessaging library dll)
@@ -937,7 +944,7 @@ if (NOT QPID_GENERATED_HEADERS_IN_SOURCE
endif (NOT QPID_GENERATED_HEADERS_IN_SOURCE)
-if (_MSC_VER)
+if (MSVC)
# Install the DtcPlugin project and call it qpidxarm.
set(AMQP_WCF_DIR ${qpid-cpp_SOURCE_DIR}/../wcf)
set(qpidxarm_SOURCES ${AMQP_WCF_DIR}/src/Apache/Qpid/DtcPlugin/DtcPlugin.cpp)
@@ -950,7 +957,7 @@ if (_MSC_VER)
COMPONENT ${QPID_COMPONENT_CLIENT})
install_pdb (qpidxarm ${QPID_COMPONENT_CLIENT})
endif (EXISTS ${qpidxarm_SOURCES})
-endif (_MSC_VER)
+endif (MSVC)
set (qpidbroker_SOURCES
${mgen_broker_cpp}
@@ -1093,6 +1100,7 @@ if(NOT WIN32)
../include/qmf/exceptions.h
../include/qmf/Handle.h
../include/qmf/ImportExport.h
+ ../include/qmf/posix/EventNotifier.h
../include/qmf/Query.h
../include/qmf/Schema.h
../include/qmf/SchemaId.h
@@ -1122,6 +1130,10 @@ if(NOT WIN32)
qmf/DataAddrImpl.h
qmf/Data.cpp
qmf/DataImpl.h
+ qmf/EventNotifierImpl.h
+ qmf/EventNotifierImpl.cpp
+ qmf/PosixEventNotifier.cpp
+ qmf/PosixEventNotifierImpl.cpp
qmf/exceptions.cpp
qmf/Expression.cpp
qmf/Expression.h
Propchange: qpid/branches/qpid-3346/qpid/cpp/src/CMakeLists.txt
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Sep 19 15:13:18 2011
@@ -3,4 +3,4 @@
/qpid/branches/0.6-release-windows-installer/qpid/cpp/src/CMakeLists.txt:926803,927233,932132
/qpid/branches/java-network-refactor/qpid/cpp/src/CMakeLists.txt:805429-825319
/qpid/branches/qpid-2935/qpid/cpp/src/CMakeLists.txt:1061302-1072333
-/qpid/trunk/qpid/cpp/src/CMakeLists.txt:1156188
+/qpid/trunk/qpid/cpp/src/CMakeLists.txt:1144319-1172654
Modified: qpid/branches/qpid-3346/qpid/cpp/src/Makefile.am
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/Makefile.am?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/Makefile.am (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/Makefile.am Mon Sep 19 15:13:18 2011
@@ -89,7 +89,7 @@ rgen_cmd=ruby -I $(rgen_dir) $(rgen_dir)
$(rgen_srcs) $(srcdir)/rubygen.mk: rgen.timestamp
rgen.timestamp: $(rgen_generator) $(specs)
- $(rgen_cmd) $(srcdir)/rubygen.mk; touch $@
+ $(rgen_cmd) $(srcdir)/rubygen.mk && touch $@
$(rgen_generator):
# The CMake version is needed for dist
@@ -793,9 +793,7 @@ libqpidmessaging_la_SOURCES = \
qpid/client/amqp0_10/SessionImpl.h \
qpid/client/amqp0_10/SessionImpl.cpp \
qpid/client/amqp0_10/SenderImpl.h \
- qpid/client/amqp0_10/SenderImpl.cpp \
- qpid/client/amqp0_10/SimpleUrlParser.h \
- qpid/client/amqp0_10/SimpleUrlParser.cpp
+ qpid/client/amqp0_10/SenderImpl.cpp
QPIDMESSAGING_VERSION_INFO = 2:0:0
libqpidmessaging_la_LDFLAGS = -version-info $(QPIDMESSAGING_VERSION_INFO)
Modified: qpid/branches/qpid-3346/qpid/cpp/src/qmf.mk
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qmf.mk?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qmf.mk (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qmf.mk Mon Sep 19 15:13:18 2011
@@ -43,6 +43,7 @@ QMF2_API = \
../include/qmf/ConsoleSession.h \
../include/qmf/DataAddr.h \
../include/qmf/Data.h \
+ ../include/qmf/posix/EventNotifier.h \
../include/qmf/exceptions.h \
../include/qmf/Handle.h \
../include/qmf/ImportExport.h \
@@ -104,6 +105,9 @@ libqmf2_la_SOURCES = \
qmf/DataAddrImpl.h \
qmf/Data.cpp \
qmf/DataImpl.h \
+ qmf/EventNotifierImpl.cpp \
+ qmf/PosixEventNotifier.cpp \
+ qmf/PosixEventNotifierImpl.cpp \
qmf/exceptions.cpp \
qmf/Expression.cpp \
qmf/Expression.h \
Modified: qpid/branches/qpid-3346/qpid/cpp/src/qmf/Agent.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qmf/Agent.cpp?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qmf/Agent.cpp (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qmf/Agent.cpp Mon Sep 19 15:13:18 2011
@@ -72,7 +72,7 @@ Schema Agent::getSchema(const SchemaId&
AgentImpl::AgentImpl(const std::string& n, uint32_t e, ConsoleSessionImpl& s) :
name(n), directSubject(n), epoch(e), session(s), touched(true), untouchedCount(0), capability(0),
- sender(session.directSender), nextCorrelator(1), schemaCache(s.schemaCache)
+ sender(session.directSender), schemaCache(s.schemaCache)
{
}
@@ -102,12 +102,11 @@ const Variant& AgentImpl::getAttribute(c
ConsoleEvent AgentImpl::query(const Query& query, Duration timeout)
{
boost::shared_ptr<SyncContext> context(new SyncContext());
- uint32_t correlator;
+ uint32_t correlator(session.correlator());
ConsoleEvent result;
{
qpid::sys::Mutex::ScopedLock l(lock);
- correlator = nextCorrelator++;
contextMap[correlator] = context;
}
try {
@@ -151,12 +150,7 @@ ConsoleEvent AgentImpl::query(const stri
uint32_t AgentImpl::queryAsync(const Query& query)
{
- uint32_t correlator;
-
- {
- qpid::sys::Mutex::ScopedLock l(lock);
- correlator = nextCorrelator++;
- }
+ uint32_t correlator(session.correlator());
sendQuery(query, correlator);
return correlator;
@@ -172,12 +166,11 @@ uint32_t AgentImpl::queryAsync(const str
ConsoleEvent AgentImpl::callMethod(const string& method, const Variant::Map& args, const DataAddr& addr, Duration timeout)
{
boost::shared_ptr<SyncContext> context(new SyncContext());
- uint32_t correlator;
+ uint32_t correlator(session.correlator());
ConsoleEvent result;
{
qpid::sys::Mutex::ScopedLock l(lock);
- correlator = nextCorrelator++;
contextMap[correlator] = context;
}
try {
@@ -213,12 +206,7 @@ ConsoleEvent AgentImpl::callMethod(const
uint32_t AgentImpl::callMethodAsync(const string& method, const Variant::Map& args, const DataAddr& addr)
{
- uint32_t correlator;
-
- {
- qpid::sys::Mutex::ScopedLock l(lock);
- correlator = nextCorrelator++;
- }
+ uint32_t correlator(session.correlator());
sendMethod(method, args, addr, correlator);
return correlator;
@@ -596,12 +584,7 @@ void AgentImpl::sendMethod(const string&
void AgentImpl::sendSchemaRequest(const SchemaId& id)
{
- uint32_t correlator;
-
- {
- qpid::sys::Mutex::ScopedLock l(lock);
- correlator = nextCorrelator++;
- }
+ uint32_t correlator(session.correlator());
if (capability >= AGENT_CAPABILITY_V2_SCHEMA) {
Query query(QUERY_SCHEMA, id);
Modified: qpid/branches/qpid-3346/qpid/cpp/src/qmf/AgentImpl.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-3346/qpid/cpp/src/qmf/AgentImpl.h?rev=1172657&r1=1172656&r2=1172657&view=diff
==============================================================================
--- qpid/branches/qpid-3346/qpid/cpp/src/qmf/AgentImpl.h (original)
+++ qpid/branches/qpid-3346/qpid/cpp/src/qmf/AgentImpl.h Mon Sep 19 15:13:18 2011
@@ -99,7 +99,6 @@ namespace qmf {
uint32_t capability;
qpid::messaging::Sender sender;
qpid::types::Variant::Map attributes;
- uint32_t nextCorrelator;
std::map<uint32_t, boost::shared_ptr<SyncContext> > contextMap;
boost::shared_ptr<SchemaCache> schemaCache;
mutable std::set<std::string> packageSet;
---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project: http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org