diff options
author | Justin Ross <jross@apache.org> | 2016-04-19 23:11:13 +0000 |
---|---|---|
committer | Justin Ross <jross@apache.org> | 2016-04-19 23:11:13 +0000 |
commit | da7718ef463775acc7d6fbecf2d64c1bbfc39fd8 (patch) | |
tree | 6da761b56ed0433b68f755927a180d615f7fb5b3 | |
parent | eb1e7851a50c6a7901c73eb42d639516c0e3ba43 (diff) | |
download | qpid-python-da7718ef463775acc7d6fbecf2d64c1bbfc39fd8.tar.gz |
QPID-7207: Remove files and components that are obsolete or no longer in use; move doc and packaging pieces to the cpp subtree
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1740032 13f79535-47bb-0310-9956-ffa450edef68
240 files changed, 0 insertions, 22292 deletions
diff --git a/qpid/LICENSE b/qpid/LICENSE deleted file mode 100644 index 2cbe987a10..0000000000 --- a/qpid/LICENSE +++ /dev/null @@ -1,8 +0,0 @@ -Please see the individual LICENSE[.txt] files in each main directory, e.g: - -cpp/LICENSE -java/LICENSE -python/LICENSE.txt -tools/LICENSE.txt -tools/src/java/LICENSE -wcf/LICENSE.txt diff --git a/qpid/NOTICE b/qpid/NOTICE deleted file mode 100644 index 39a002e222..0000000000 --- a/qpid/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ -Please see the individual NOTICE[.txt] files in each main directory, e.g: - -cpp/NOTICE -java/NOTICE -python/NOTICE.txt -tools/NOTICE.txt -tools/src/java/NOTICE -wcf/NOTICE.txt diff --git a/qpid/QPID_VERSION.txt b/qpid/QPID_VERSION.txt deleted file mode 100644 index c74e8a041a..0000000000 --- a/qpid/QPID_VERSION.txt +++ /dev/null @@ -1 +0,0 @@ -0.35 diff --git a/qpid/README.txt b/qpid/README.txt deleted file mode 100644 index ccd92c757b..0000000000 --- a/qpid/README.txt +++ /dev/null @@ -1,57 +0,0 @@ -Apache Qpid is a high-speed, language independent, platform -independent enterprise messaging system. It currently provides two -messaging brokers (one implemented in C++, one implemented in Java), -and messaging client libraries for Java JMS, C++, C# .NET, Python, -Ruby, and WCF. The messaging protocol for Apache Qpid is AMQP -(Advanced Message Queuing Protocol). You can read more about Qpid -here: - - http://qpid.apache.org/ - -Documentation can be found here: - - http://qpid.apache.org/documentation.html - -Qpid includes many components, which are built in various ways. Each -component has a README.txt. Here are the subdirectories that contain -the basic components: - -Messaging Broker (implemented in C++): - - ./cpp - -Messaging Broker (implemented in Java): - - ./java - -C++ Messaging Client Libraries - - ./cpp - -Java JMS Client Libraries - - ./java/client - -Python Client Libraries - - ./python - -WCF Support - - ./wcf - -Management Tools (implemented in Python): - - ./tools - -Management Tools (implemented in Java): - - ./java/management - -Documentation: - - ./doc - - -Further information about the organization of Qpid source components may -be found in ./doc/dev-readme/QPID-Component-README.pdf. diff --git a/qpid/bin/LICENSE b/qpid/bin/LICENSE deleted file mode 100644 index bc46b77047..0000000000 --- a/qpid/bin/LICENSE +++ /dev/null @@ -1,206 +0,0 @@ -========================================================================= -== Apache License == -========================================================================= - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/qpid/bin/NOTICE b/qpid/bin/NOTICE deleted file mode 100644 index 05f39ba176..0000000000 --- a/qpid/bin/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ -// ------------------------------------------------------------------ -// NOTICE file corresponding to the section 4d of The Apache License, -// Version 2.0, in this case for Qpid bin scripts -// ------------------------------------------------------------------ - -Apache Qpid -Copyright 2006-2008 Apache Software Foundation - diff --git a/qpid/bin/install-cpp-python b/qpid/bin/install-cpp-python deleted file mode 100755 index d43e8e4899..0000000000 --- a/qpid/bin/install-cpp-python +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -# -# 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. -# - - -# -# Install C++ build and python tools to the standard places in a Unix buld -# WARNING: Will destroy any existing installation! -# - -# NOTE: build must be configured like this: -# ../qpid/cpp/configure --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --libdir=/usr/lib64 -# NOTE: Must run as root. - -usage() { - cat <<EOF -Usage $0 -pc <cpp-build-directory> --p <prefix> : Prefix to install python --s : Skip C++ installation -EOF - - exit 1 -} - -fail() { echo $*; exit 1; } - -while getopts "ps" opt; do - case $opt in - p) PY_PREFIX="--prefix $OPTARG";; - s) SKIP_CPP=1;; - *) usage;; - esac -done -shift `expr $OPTIND - 1` -BUILD=$1 -SRC=$(dirname $0)/.. - -# Install python -cd $SRC || fail "No such directory: $SRC" -for d in python tools extras/qmf; do - ( - cd $d || fail "No such directory: $(pwd)/$d" - ./setup.py install || fail Python install failed in $(pwd) - ) -done - -if test $SKIP_CPP; then exit; fi - -test -n "$BUILD" || { echo "No build directory."; usage; } -test -d "$BUILD" || fail "No such directory: $BUILD" -SRC=$(dirname $BUILD) - - # Install C++ -cd $BUILD -make -j1 install || fail "C++ install failed in $BUILD" - -# NOTE: setup.py does not uninstall, but you can get a list of files installed with: -# setup.py install --record <output-file> - - diff --git a/qpid/bin/mvn-deploy-qpid-java.sh b/qpid/bin/mvn-deploy-qpid-java.sh deleted file mode 100755 index 3c2a9fd05f..0000000000 --- a/qpid/bin/mvn-deploy-qpid-java.sh +++ /dev/null @@ -1,71 +0,0 @@ -# -# -# 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. -# -# - -#!/bin/sh - -qpid_version=$1 -repo=$2 - -if [ -z "$qpid_version" -o -z "$repo" ]; then - echo "Usage: mvn-deploy-qpid-java.sh <qpid-version> <mvn-repo>" - exit 1 -fi - -set -xe - - -build_dir=build/lib - -deploy_artifact() { - mvn deploy:deploy-file -DuniqueVersion=false -Durl=$repo -Dfile=${build_dir}/$1-${qpid_version}.jar -DgroupId=org.apache.qpid -DartifactId=$1 -Dversion=${qpid_version} -Dpackaging=jar -} - -deploy_artifact_with_classifier() { - mvn deploy:deploy-file -DuniqueVersion=false -Durl=$repo -Dfile=${build_dir}/$1-$2-${qpid_version}.jar -DgroupId=org.apache.qpid -DartifactId=$1 -Dclassifier=$2 -Dversion=${qpid_version} -Dpackaging=jar -} - -deploy_artifact qpid-broker -deploy_artifact_with_classifier qpid-broker-plugins tests -deploy_artifact_with_classifier qpid-broker tests -deploy_artifact qpid-client-example -deploy_artifact_with_classifier qpid-client-example tests -deploy_artifact qpid-client -deploy_artifact_with_classifier qpid-client tests -deploy_artifact qpid-common -deploy_artifact_with_classifier qpid-common tests -deploy_artifact qpid-integrationtests -deploy_artifact_with_classifier qpid-integrationtests tests -deploy_artifact qpid-junit-toolkit -deploy_artifact_with_classifier qpid-junit-toolkit tests -deploy_artifact qpid-management-eclipse-plugin -deploy_artifact_with_classifier qpid-management-eclipse-plugin tests -deploy_artifact qpid-perftests -deploy_artifact_with_classifier qpid-perftests tests -deploy_artifact qpid-systests -deploy_artifact_with_classifier qpid-systests tests -deploy_artifact qpid-testkit -deploy_artifact_with_classifier qpid-testkit tests -deploy_artifact qpid-tools -deploy_artifact_with_classifier qpid-tools tests - -build_dir=build/lib/plugins - -deploy_artifact qpid-broker-plugins diff --git a/qpid/bin/set_svn_properties.sh b/qpid/bin/set_svn_properties.sh deleted file mode 100755 index cc29490eea..0000000000 --- a/qpid/bin/set_svn_properties.sh +++ /dev/null @@ -1,133 +0,0 @@ -# -# -# 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. -# - -# This script will set the proper svn properties on all the files in the tree. -# It pretty much requires a gnu compatible xargs (for the -r flag). Running -# on Linux is probably the best option, or gnuxargs is available for OS X from -# darwinports. - - -find . -name "*.java" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.java" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "*.py" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native - -find . -name "*.rb" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native - -find . -name "*.xml" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml -find . -name "*.xml" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.xml" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "*.xsl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml -find . -name "*.xsl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.xsl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "*.xsd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml -find . -name "*.xsd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.xsd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "*.wsdl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml -find . -name "*.wsdl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.wsdl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "*.properties" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain -find . -name "*.properties" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.properties" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "*.txt" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.txt" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain - -find . -name "*.htm*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.htm*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/html -find . -name "*.htm*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "README*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "README*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain - -find . -name "LICENSE*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "LICENSE*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain - -find . -name "NOTICE*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "NOTICE*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain - -find . -name "TODO*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "TODO*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain - -find . -name "KEYS*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "KEYS*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain - -find . -name "*.png" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type image/png -find . -name "*.gif" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type image/gif -find . -name "*.jpg" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type image/jpeg -find . -name "*.jpeg" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type image/jpeg - - -find . -name "*.scdl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.scdl" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml - -find . -name "*.fragment" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.fragment" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml - -find . -name "*.componentType" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.componentType" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml - -find . -name "*.wsdd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml -find . -name "*.wsdd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native - -find . -name "sca.subsystem" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml -find . -name "sca.subsystem" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "Tuscany-model.config" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/xml -find . -name "Tuscany-model.config" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native - - - -find . -name "*.cpp" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.cpp" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "*.c" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.c" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "*.h" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.h" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "*.am" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.am" | grep -v ".svn" | xargs -n 1 -r svn propset svn:keywords "Rev Date" - -find . -name "ChangeLog*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "ChangeLog*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain - -find . -name "*.sh" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.sh" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain -find . -name "*.sh" | grep -v ".svn" | xargs -n 1 -r svn propset svn:executable "" - -find . -name "*.bat" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style CRLF -find . -name "*.bat" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain - -find . -name "*.cmd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "*.cmd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain -find . -name "*.cmd" | grep -v ".svn" | xargs -n 1 -r svn propset svn:executable "" - -find . -name "INSTALL*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "INSTALL*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain -find . -name "COPYING*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "COPYING*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain -find . -name "NEWS*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:eol-style native -find . -name "NEWS*" | grep -v ".svn" | xargs -n 1 -r svn propset svn:mime-type text/plain - diff --git a/qpid/buildtools/LICENSE b/qpid/buildtools/LICENSE deleted file mode 100644 index bc46b77047..0000000000 --- a/qpid/buildtools/LICENSE +++ /dev/null @@ -1,206 +0,0 @@ -========================================================================= -== Apache License == -========================================================================= - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/qpid/buildtools/NOTICE b/qpid/buildtools/NOTICE deleted file mode 100644 index 5813a7a09a..0000000000 --- a/qpid/buildtools/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ -// ------------------------------------------------------------------ -// NOTICE file corresponding to the section 4d of The Apache License, -// Version 2.0, in this case for Qpid buildTools -// ------------------------------------------------------------------ - -Apache Qpid -Copyright 2006-2008 Apache Software Foundation - diff --git a/qpid/buildtools/buildCreator/build.config b/qpid/buildtools/buildCreator/build.config deleted file mode 100644 index cb45e99a6e..0000000000 --- a/qpid/buildtools/buildCreator/build.config +++ /dev/null @@ -1,37 +0,0 @@ -<!-- - - - - 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. - - - --> -<builder> - <environment> - <version>M4.0-beta</version> - </environment> - - <sources> - <source> - <name>qpid</name> - <type>svn</type> - <url>https://svn.eu.apache.org/repos/asf/incubator/qpid/trunk/qpid/</url> - </source> - </sources> - - <builds> - <include>qpid.build</include> - </builds> -</builder> diff --git a/qpid/buildtools/buildCreator/buildCreator.py b/qpid/buildtools/buildCreator/buildCreator.py deleted file mode 100755 index 0a26ce09b0..0000000000 --- a/qpid/buildtools/buildCreator/buildCreator.py +++ /dev/null @@ -1,1472 +0,0 @@ -#!/usr/bin/env python -# -# -# 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. - -import os -import re -import datetime -import urllib -import sys -import string - -from xml.dom import minidom -from optparse import OptionParser - -if map(int, string.split(string.split(sys.version)[0], ".")) < [2, 4, 0]: - print ("subprocess is required for this tool and is not present in versions prior to 2.4.0") - try: - import subprocess - except ImportError: - print ("subprocess module not found please install it locally or upgrade your python version") - sys.exit(1) - -import subprocess -from subprocess import Popen - -TOOL_NAME="buildCreator.py" - -#Default Build script -DEFAULT_BUILD="build.config" - -# Path locations -DEFAULT_ROOTDIR="builder" -SOURCE_DIR="src" -PATCH_DIR="patch" -BUILD_DIR="build" -RELEASE_DIR="release" - -# Command Binaries -SVN='svn' -SVN_BIN='svn' -HTTP='http' -FTP='ftp' -WGET_BIN='wget' -FILE='file' -CP_BIN='cp' -PATCH_BIN='patch' -FILE_BIN='file' -LS_BIN='ls' -TAR_BIN='tar' -BZIP2_BIN='bzip2' -UNZIP_BIN='unzip' -ECHO_BIN='echo' -SVNVERSION_BIN='svnversion' - - - -GZIP_DATA='gzip compressed data' -BZIP2_DATA='bzip2 compressed data' -ZIP_DATA='Zip archive data' -TAR_DATA='POSIX tar archive' -DIFF_FILE="'diff' output text" - -#Build Targets -DISTCLEAN='distclean' -CLEAN='clean' -RETRIEVE='retrieve' -PREPARE='prepare' -PATCH='patch' -SHOWBUILDS='showbuilds' -BUILD='build' -RELEASE='release' -FULL='full' -HELP='help' -DEFAULT_TARGET=FULL - -# XML Elements toplevel -BUILDER="builder" -ENVIRONMENT="environment" -SOURCES="sources" -SOURCE="source" -PATCHES="patches" -PATCH="patch" -BUILDS="builds" -INCLUDE="include" -DEPENDENCY='dependency' -TARGETS='targets' -SCRIPT='script' - -# XML Elements - Source/Patch elements -NAME="name" -TYPE="type" -URL="url" -REVISION="revision" -ROOTDIR="root" -VERSION="version" -PREFIX='prefix' -PATH='path' - -PATH_SEP=os.sep - -_source=None -_target=DEFAULT_BUILD -_log = True -_verbose = False -_debug = False -_ignoreErrors = False - -_charIndex = 0 -_waitingChars = ['-', '/' , '|', '\\'] - -def showUsage(): - print TOOL_NAME+" [-c|--configure <config file>] [-v| --verbose] [-q|--quiet] [-i|--ignore-errors] [<build target>] [options]" - print "Available Targets:" - print " distclean [source] - Remove all or specified retrieved source" - print " clean [source] - Remove all or specified source build directory" - print " retrieve [source] - Retrieve all or specified source" - print " prepare [source] - Prepare all or specified source : i.e. extract archives" - print " patch [source] - Patch all or specified source" - print " showbuilds - List all builds" - print " build [build] - Perform the build scripts for all or specified build" - print " release [build] - Perform the release scripts for all or specified source" - print " full - Perfrom clean, retrieve, prepare, patch, build, release for all builds (DEFAULT)" - -def main(): - global _log, _verbose, _debug, _rootDir, _target, _source, _baseConfiguration, _ignoreErrors - - # Load the - parser = OptionParser() - parser.add_option("-c", "--config", dest="config", - action="store", default=DEFAULT_BUILD, - help="set configuration file : default = " + DEFAULT_BUILD) - - parser.add_option("-v", "--verbose", dest="verbose", - action="store_true", default=False, help="enable verbose output") - - parser.add_option("-d", "--debug", dest="debug", - action="store_true", default=False, help="enable debug output") - - parser.add_option("-q", "--quiet", dest="quiet", - action="store_false", default=True, help="Enable quiet ouptut") - - parser.add_option("-i", "--ignore-errors", dest="ignoreErrors", - action="store_true", default=False, help="Ignore errors") - - - (options, args) = parser.parse_args() - - _verbose = options.verbose - _debug = options.debug - _log = options.quiet - _ignoreErrors = options.ignoreErrors - - log("Logging Enabled") - verbose("Verbose Output Enabled") - debug("Debug Enabled") - - if (len(args) > 2): - showUsage() - sys.exit(1) - else: - # NOTE : Would be good to be able to do builder.py clean build release - if (len(args) > 0 ): - # Override the default target - _target = checkTarget(args[0]) - # limit the comand to just the specified source - if (len(args) > 1 ): - _source = args[1] - else: - _source = None - else: - _target = FULL - - - _baseConfiguration = loadBaseConfiguration(options.config) - - debug ("Loading Environment") - prepareEnvironment(_baseConfiguration.getElementsByTagName(ENVIRONMENT)[0]) - - if _target == DISTCLEAN: - distclean() - - if _target == CLEAN or _target == FULL: - clean() - - if _target == RETRIEVE or _target == FULL: - try: - retrieve() - except KeyboardInterrupt: - log ("User Interrupted preparation") - sys.exit(0) - - if _target == PREPARE or _target == FULL: - prepare() - - if _target == PATCH or _target == FULL: - patch() - - if _target == SHOWBUILDS: - showBuilds() - - if _target == BUILD or _target == FULL: - build() - - if _target == RELEASE or _target == FULL: - release() - - log("Complete") - -def checkTarget(target): - - if target == HELP: - showUsage() - sys.exit(0) - - if target == DISTCLEAN: - return DISTCLEAN - - if target == CLEAN: - return CLEAN - - if target == RETRIEVE: - return RETRIEVE - - if target == PREPARE: - return PREPARE - - if target == PATCH: - return PATCH - - if target == SHOWBUILDS: - return SHOWBUILDS - - if target == BUILD: - return BUILD - - if target == RELEASE: - return RELEASE - - if target == FULL: - return FULL - - warn("Target: '"+target+"' not valid") - showUsage() - sys.exit(1) - - -################################################################################ -# -# Environment -# -################################################################################ -def prepareEnvironment(env): - global _rootDir - - rootdir = env.getElementsByTagName(ROOTDIR) - if (rootdir.length > 0): - _rootDir = getValue(rootdir[0]) - else: - verbose ("Using default build dir: "+DEFAULT_ROOTDIR) - _rootDir = os.getcwd() + PATH_SEP + DEFAULT_ROOTDIR - - if _rootDir == "": - verbose (ROOTDIR+" value is empty. Please specify a value for "+ ROOTDIR) - attemptExit(0) - - if (os.path.exists(_rootDir)): - verbose ("Using Existing root dir: "+_rootDir) - else: - mkdir(_rootDir) - -################################################################################ -# -# Clean Methods -# -################################################################################ -def clean(): - global _source - sources = getSourceList() - - if len(sources) > 0: - log ("Removing built code...") - performed = False - for source in sources: - if _source != None: - if getName(source) == _source: - performed = True - removeDir(source, BUILD_DIR) - else: - removeDir(source, BUILD_DIR) - - if _source == None: - deleteDir(_rootDir + PATH_SEP + BUILD_DIR) - - builds = getBuildList() - if len(builds) > 0: - log ("Removing built releases...") - for build in builds: - if _source != None: - if getName(build) == _source: - performed = True - removeDir(build, RELEASE_DIR) - else: - removeDir(build, RELEASE_DIR) - if _source == None: - deleteDir(_rootDir + PATH_SEP + RELEASE_DIR) - - if _source != None: - if not performed: - fatal("No such source:" + _source); - - - -def distclean(): - sources = getSourceList() - - if len(sources) > 0: - log ("Removing source...") - for source in sources: - if _source != None: - if getName(source) == _source: - performed = True - removeDir(source, SOURCE_DIR) - else: - removeDir(source, SOURCE_DIR) - - if _source == None: - deleteDir(_rootDir + PATH_SEP + SOURCE_DIR) - - log ("Removing built code...") - for source in sources: - if _source != None: - if getName(source) == _source: - performed = True - removeDir(source, BUILD_DIR) - else: - removeDir(source, BUILD_DIR) - if _source == None: - deleteDir(_rootDir + PATH_SEP + BUILD_DIR) - - patches =getPatchList() - if len(patches) > 0: - log ("Removing patches...") - for patch in patches: - if _source != None: - if getName(patch) == _source: - performed = True - removeDir(patch, PATCH_DIR) - else: - removeDir(patch, PATCH_DIR) - if _source == None: - deleteDir(_rootDir + PATH_SEP + PATCH_DIR) - - - builds = getBuildList() - if len(builds) > 0: - log ("Removing built releases...") - for build in builds: - if _source != None: - if getName(build) == _source: - performed = True - removeDir(build, RELEASE_DIR) - else: - removeDir(build, RELEASE_DIR) - if _source == None: - deleteDir(_rootDir + PATH_SEP + RELEASE_DIR) - - - if _source == None: - deleteDir(_rootDir) - - if _source != None: - if not performed: - fatal("No such source:" + _source); - - - -def removeDir(source, rootdir): - name = getName(source) - deleteDir(_rootDir + PATH_SEP + rootdir + PATH_SEP + name) - -################################################################################ -# -# Retrieve Methods -# -################################################################################ -def retrieve(): - global _source - sources = getSourceList() - - # Retreive Source - performed=False - if len(sources) > 0: - log ("Retrieving source...") - - mkdir(_rootDir + PATH_SEP + SOURCE_DIR) - - for source in sources: - if _source != None: - if getName(source) == _source: - performed = True - downloadSource(source, SOURCE_DIR) - else: - downloadSource(source, SOURCE_DIR) - - # Retreive Patches - patches = getPatchList() - if len(patches) > 0: - - log ("Retrieving patches...") - - mkdir(_rootDir + PATH_SEP + PATCH_DIR) - - for patch in patches: - if _source != None: - if getName(patch) == _source: - performed = True - downloadSource(patch, PATCH_DIR) - else: - downloadSource(patch, PATCH_DIR) - - if _source != None: - if not performed: - fatal("No such patch:" + _source); - - -################################################################################ -# -# Prepare Methods -# -################################################################################ - -def prepare(): - verbose("Prepare") - - mkdir(_rootDir + PATH_SEP + BUILD_DIR) - - sources = getSourceList() - performed = False - if len(sources) > 0: - log ("Preparing source...") - for source in sources: - if _source != None: - if getName(source) == _source: - log_no_newline("Preparing "+getName(source)+": ") - performed = True - postProcess(source, SOURCE_DIR) - else: - log_no_newline("Preparing "+getName(source)+": ") - postProcess(source, SOURCE_DIR) - if _source != None: - if not performed: - fatal("No such source:" + _source); - - patches = getPatchList() - if len(patches) > 0: - log ("Preparing patches...") - for patch in patches: - if _source != None: - if getName(patch) == _source: - performed = True - log("Preparing "+getName(patch)) - postProcess(patch, PATCH_DIR) - else: - log("Preparing "+getName(patch)) - postProcess(patch, PATCH_DIR) - - if _source != None: - if not performed: - fatal("No such patch:" + _source); - - -def postProcess(item, destination): - name = getName(item) - type = getType(item) - - verbose("Post Processing:"+name) - - targetdir = _rootDir + PATH_SEP + destination + PATH_SEP + name - - builddir = _rootDir + PATH_SEP + BUILD_DIR + PATH_SEP + name - - - if type == SVN: - # Do we want to perform an export? - - #extractcommand=SVN_BIN+" export "+ targetdir +" "+ builddir - # Use -v just now so we can show progress - extractcommand=CP_BIN+" -rvf "+ targetdir +" "+ builddir - - runCommand(extractcommand, False) - - else: - if type == FILE or type == HTTP or type == FTP: - - mkdir(builddir) - - # Look at all the files and see if they need unpacks - for root, dirs, files in os.walk(targetdir, topdown=False): - for file in files: - command = FILE_BIN+" "+root+PATH_SEP+file - - result = Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - line = result.stdout.readline() - firstline=line - while (line != "" ): - # process nextline - line=result.stdout.readline() - - result.wait() - - if result.returncode != 0: - fatal("Download (" + name + ") contained unrecognized file type:"+ firstline) - - - extractcommand="" - - if firstline.find(GZIP_DATA) != -1: - extractcommand=TAR_BIN+" -vxzf "+root+PATH_SEP+file+" -C " + builddir - - if firstline.find(BZIP2_DATA) != -1: - extractcommand=TAR_BIN+" -vxjf "+root+PATH_SEP+file+" -C " + builddir - - if firstline.find(ZIP_DATA) != -1: - extractcommand=UNZIP_BIN+" -v "+root+PATH_SEP+file+" -d "+ builddir - - if firstline.find(TAR_DATA) != -1: - extractcommand=TAR_BIN+" -vxf "+root+PATH_SEP+file+" -C "+ builddir - - if firstline.find(DIFF_FILE) != -1 or firstline.find("text"): - extractcommand=CP_BIN+" -r "+root+PATH_SEP+file+" "+ builddir - - - - if not extractcommand=="": - log_no_newline("Extracting archive:" + file+": " ) - runCommand(extractcommand, False) - else: - fatal("Download (" + name + ") contained unsupported file type:"+ firstline) - - - -################################################################################ -# -# Patch Methods -# -################################################################################ -def patch(): - - # Retreive Patches - patches= getPatchList() - if len(patches) > 0: - performed = False - for patch in patches: - if _source != None: - if getName(source) == _source: - performed = True - applyPatch(patch) - else: - applyPatch(patch) - - if _source != None: - if not performed: - fatal("No such patch:" + _source); - - -def applyPatch(patch): - global _rootDir - - name = getName(patch) - type = getType(patch) - source = getValue(patch.getElementsByTagName(SOURCE)[0]) - if (patch.getElementsByTagName(PREFIX).length > 0): - prefix = getValue(patch.getElementsByTagName(PREFIX)[0]) - else: - prefix = None - - if (patch.getElementsByTagName(PATH).length > 0): - path= getValue(patch.getElementsByTagName(PATH)[0]) - else: - path = None - - - basecommand = PATCH_BIN - - if prefix != None: - basecommand = basecommand + " -p "+prefix - - basecommand = basecommand + " -E -d "+ _rootDir + PATH_SEP + BUILD_DIR + PATH_SEP + source + PATH_SEP - - if path != None: - basecommand = basecommand + path - - basecommand = basecommand + " < " - - patchSource= _rootDir + PATH_SEP + PATCH_DIR + PATH_SEP + name - - for root, dirs, files in os.walk(patchSource): - if '.svn' in dirs: - dirs.remove('.svn') - files.sort() - for patchName in files: - log("Applying patch '" + name + "'("+patchName+") to " + source) - runCommandShowError(basecommand + patchSource + PATH_SEP + patchName) - - -################################################################################ -# -# build Methods -# -################################################################################ -def showBuilds(): - builds = getNamesfromBuildList(getBuildList()) - if len(builds) > 0: - log("Available Builds:") - for build in builds: - log(" "+build) - else: - log("No builds available") - -# -# Given a list of build elements extract the Name values and return as a list -# -def getNamesfromBuildList(list): - names=[] - for item in list: - name = getName(item) - if name != None: - names.append(name) - return names - -def build(): - doBuildAction(BUILD) - - - -################################################################################ -# -# Release Methods -# -################################################################################ -def release(): - log ("Releasing...") - mkdir(_rootDir + PATH_SEP + RELEASE_DIR) - - builds = getBuildList() - - for build in builds: - if _source != None: - if getName(build) == _source: - mkdir(_rootDir + PATH_SEP + RELEASE_DIR + PATH_SEP + getName(build)) - else: - mkdir(_rootDir + PATH_SEP + RELEASE_DIR + PATH_SEP + getName(build)) - - doBuildAction(RELEASE) - - - -################################################################################ -# -# Build Helper Methods -# -################################################################################ - -def doBuildAction(action): - config = _baseConfiguration - - if len(getSourceList()) > 0: - log("Performing "+ action.title() +"...") - - builds = getBuildList() - - performed = False - for build in builds: - if _source != None: - if getName(build) == _source: - performed = True - performScript(build , action) - else: - performScript(build, action) - - if _source != None: - if not performed: - fatal("No such build:" + _source); - - -def performScript(build, scriptName): - name = getName(build) - - checkDependencies(build) - - verbose("Running "+scriptName+":"+name) - - targets = build.getElementsByTagName(TARGETS) - - if targets.length > 0: - target = targets[0].getElementsByTagName(scriptName) - - if target.length > 1: - fatal("More than one build target specified") - - if target.length == 0: - fatal("No build target specified") - - script = getValue(target[0].getElementsByTagName(SCRIPT)[0]) - - script = peformSubstitutionsInScript(build, script) - - debug(script) - - runScript(script) - - else: - fatal("Build "+name+" has no build targets") - - -def checkDependencies(build): - name = getName(build) - dependencies = build.getElementsByTagName(DEPENDENCY) - - if dependencies > 0: - for dependency in dependencies : - sources = dependency.getElementsByTagName(SOURCE) - if sources.length == 0: - fatal("No sources specified in dependency block for build:"+name) - else: - for source in sources: - sourceDependency = getValue(source) - if not (sourceDefined(sourceDependency)): - fatal("Unable to build "+name+" as specifed dependency("+sourceDependency +") is not available") - -def sourceDefined(name): - for source in getSourceList(): - sourcename = getValue(source.getElementsByTagName(NAME)[0]) - if sourcename == name: - return True - return False - - -def runScript(script): - (returncode, stdout, stderr) = runCommandWithOutput(script) - - if _debug: - for line in stdout: - debug(line) - for line in stderr: - debug(line) - - if returncode != 0: - for line in stdout: - warn(line) - for line in stderr: - warn(line) - - warn("Script Failed") - - attemptExit(1) - - -################################################################################ -# -# XML Helper Methods -# -################################################################################ - -def loadBaseConfiguration(config): - log ("Loading configuration:" + config) - full = minidom.parse(config) - return full.getElementsByTagName(BUILDER)[0] - -# -# Assumes that we have a <node>text</node> element and returns the text value. -# -def getValue(node): - if node.childNodes.length > 0: - return node.childNodes[0].data - else: - return "" - -def getEnvironment(): - env = _baseConfiguration.getElementsByTagName(ENVIRONMENT) - if env.length > 0: - return env[0] - else: - return None - -# -# Returns the value of the NAME element contained in the specified item -# -def getName(item): - name = item.getElementsByTagName(NAME) - if name.length > 0: - return getValue(name[0]) - -# -# Returns the value of the TYPE element contained in the specified item -# -def getType(item): - type = item.getElementsByTagName(TYPE) - if type.length > 0: - return getValue(type[0]) - -# -# Returns the value of the URL element contained in the specified item -# -def getURL(item): - url = item.getElementsByTagName(URL) - if url.length > 0: - return getValue(url[0]) - -# -# Return the list of sources in this build configuration -# If no sources are available then this is logged as a fatal error. -# -def getSourceList(): - config = _baseConfiguration - sourceCount = config.getElementsByTagName(SOURCES).length - if sourceCount > 0: - return config.getElementsByTagName(SOURCES)[0].getElementsByTagName(SOURCE) - else: - fatal("No source elements defined.") -# -# Return the list of patches in this build configuration -# -def getPatchList(): - config = _baseConfiguration - patchCount = config.getElementsByTagName(PATCHES).length - if patchCount > 0: - return config.getElementsByTagName(PATCHES)[0].getElementsByTagName(PATCH) - else: - return [] - -# Returns a list of build elements including any any included build files -# Currently nested build elements are not supported so all builds must be specified via the <include> tag. -# -def getBuildList(): - config = _baseConfiguration - - builds = config.getElementsByTagName(BUILDS) - buildcount = builds.length - - if buildcount > 0: - build = builds[0] - useInclude = build.getElementsByTagName(INCLUDE).length > 0 - - # If we are using includes then build a list of all the files we need to include - if useInclude: - return getIncludeList(build) - - else: - warn("Nested builds not currently supported") - else: - fatal("No Builds defined in config") - -# -# Look at all <include> values in the given element and return the list of inlcudes -# -def getIncludeList(build): - includelist=[] - for include in build.getElementsByTagName(INCLUDE): - for item in getIncludeValue(getValue(include)): - includelist.append(item) - - return includelist - -# -# Process in the given include value. -# This is done by performing `ls <include>` -# This means includes such as 'builds/*.config' will match multiple includes and return all entries -# -# Any error in performing the ls is printed and the tool exits (unless ignore errors) -# -def getIncludeValue(include): - debug("Loading Includes:"+include+" ") - - command = LS_BIN+" "+include - (returncode, stdout, stderr) = runCommandWithOutput(command) - - if returncode == 0: - values=[] - for line in stdout: - include = loadIncludeFile(line) - if not include == None: - values.append(include) - return values - else: - for line in stderr: - warn(line) - attemptExit(1) - -# -# Given a file name parse the XML. Any trailing '\n's that the ls command may have added are removed here. -# The file is checked to ensure that it is a <builds> file -# The first <build> element is returned. -# -# TODO: Allow multiple builds per file. -# -def loadIncludeFile(file): - buildFile = minidom.parse(file.rstrip('\n')) - - builds = buildFile.getElementsByTagName(BUILDS) - - if builds.length != 1: - warn("Build Configuration does not contain any <"+BUILDS+"> definitions") - else: - buildElements = builds[0].getElementsByTagName(BUILD) - if not buildElements.length > 0: - warn("Build Configuration does not contain any <"+BUILD+"> definitions") - else: - if buildElements.length > 0: - build = buildElements[0] - # getElementsByTagName is recursive so this will pick up the sub element build - # Only use the first element - namecount = build.getElementsByTagName(NAME).length - if namecount > 0: - return build - else: - return None - -# -# Given the build target and a script substitute $value entries in script for values in -# the Environment -# the Source entries <source><name> -# the build <build><name> -# the release location : _rootDir + PATH_SEP + RELEASE_DIR + PATH_SEP + buildName -# -def peformSubstitutionsInScript(build, script): - buildName = getName(build) - sources = getSourceList() - - #Replace Build name - script = script.replace("$build", buildName) - - #Replace release directory - releaseDir = _rootDir + PATH_SEP + RELEASE_DIR + PATH_SEP + buildName - script = script.replace("$release", releaseDir) - - # Replace Source varables - for source in sources: - sourceName = getName(source) - - search = "$"+sourceName - - sourcePath = source.getElementsByTagName(PATH) - - replacement = _rootDir + PATH_SEP + BUILD_DIR + PATH_SEP + sourceName - if sourcePath.length > 0: - replacement = replacement + PATH_SEP + getValue(sourcePath[0]) - - script = script.replace(search,replacement) - - # Take values from the environment script for replacement - env = getEnvironment() - if env != None: - for item in env.childNodes: - if item.nodeType == 1: - - search = "$"+item.tagName - replace = item.childNodes[0].data - - script = script.replace(search,replace) - - # Perform keyword substitution replacements - # Currently only one substitution exists so for simplisity fix it here - writeVersionSubstitution = script.find("$writeVersions") - if writeVersionSubstitution != -1: - - #Extract Filename - fileNameStart = script.find("(",writeVersionSubstitution) - fileNameEnd = script.find(")",fileNameStart) - fileName= script[fileNameStart+1:fileNameEnd] - - substitution = createVersionSubstitution(build, fileName) - - script = script.replace("$writeVersions(" + fileName + ")", substitution) - - - return script - -################################################################################ -# -# Keyword Substitutions -# -################################################################################ - -# -# Use the specified build as to lookup all associated source/patches and write out their details -# to the specified file using shell redirects. redirects are to be used as the absolute filename -# location may not be known as the name comes in via the release script -# -def createVersionSubstitution(build, filename): - substitution = "" - sources = getSourceList(); - - dependencies = build.getElementsByTagName(DEPENDENCY) - - if dependencies > 0: - substitution += "\n echo 'Source Version Information:'>> " + filename - for dependency in dependencies : - depSources = dependency.getElementsByTagName(SOURCE) - # Can assume we have dependencies as we would have failed before now - for source in depSources: - sourceDependency = getValue(source) - # We can assume source is valid. - for s in sources: - if sourceDependency == getName(s): - # provide header <source>:<type>:<revision> - substitution += "\n " + ECHO_BIN + " -n '" + sourceDependency + ":" \ - + getType(s) + ":' >> " + filename - substitution += "\n" + getVersionCommand(s) + " >>" + filename - # Add Source URL to Revisions file - url = getValue(s.getElementsByTagName(URL)[0]) - substitution += "\n" + ECHO_BIN + " \"URL:" + url + "\" >> "+filename - # Add Patches applied to this source to revisions file - substitution += addPatchVersions(s, filename) - - return substitution - -# -# Use the specified source as to lookup all associated patches and write their details out the -# the specified file using shell redirects. redirects are to be used as the absolute filename -# location may not be known as the name comes in via the release script -# -def addPatchVersions(source, filename): - substitution = "" - - patches = getPatchList() - - sourceName = getName(source) - - for patch in patches: - patchSourceName = getValue(patch.getElementsByTagName(SOURCE)[0]) - - if sourceName == patchSourceName: - type = getType(patch) - substitution += "\n" + ECHO_BIN + " \"\t"+getName(patch)+":"+type + "\" >> "+filename - url = getValue(patch.getElementsByTagName(URL)[0]) - substitution += "\n" + ECHO_BIN + " \"\t\tURL:" + url + "\" >> "+filename - if (type == SVN): - if (patch.getElementsByTagName(REVISION).length > 0): - substitution += "\n" + ECHO_BIN + " \"\t\tREVISION:"+ \ - getValue(patch.getElementsByTagName(REVISION)[0]) + "\" >> " + filename - else: - substitution += "\n" + ECHO_BIN + " -n \"\t\tREVISION: \" >> " + filename - substitution += "\n" + SVNVERSION_BIN + " " + _rootDir + PATH_SEP + PATCH_DIR + PATH_SEP + getName(patch) + " >> " + filename - - - if (patch.getElementsByTagName(PREFIX).length > 0): - substitution += "\n" + ECHO_BIN + " \"\t\tPREFIX: " + \ - getValue(patch.getElementsByTagName(PREFIX)[0]) + "\" >> " + filename - - if (patch.getElementsByTagName(PATH).length > 0): - substitution += "\n" + ECHO_BIN + " \"\t\tPATH: " + \ - getValue(patch.getElementsByTagName(PATH)[0]) + "\" >> " + filename - - global _rootDir - patchSource= _rootDir + PATH_SEP + PATCH_DIR + PATH_SEP + getName(patch) - - # - # Include the list of patches files applied - # - for root, dirs, files in os.walk(patchSource): - if '.svn' in dirs: - dirs.remove('.svn') - files.sort() - for patchName in files: - substitution += "\n" + ECHO_BIN + " \"\t\tFILE: " + patchName + "\" >> " + filename - - - - - if (substitution != ""): - return "\n" + ECHO_BIN + " \"\tPatches applied to " + sourceName + ":\" >> " + filename + substitution - else: - return "\n" + ECHO_BIN + " \"\tNo Patches\" >> " + filename - - -# -# Given a source entry return the command that will provide the current version -# of that source. -# i.e. svn source : svnversion <path to source> -# http source : echo <URL> -# -def getVersionCommand(source): - global _rootDir - type = getType(source) - - versionCommand="" - - if type == SVN: - versionCommand=SVNVERSION_BIN+" "+_rootDir + PATH_SEP + SOURCE_DIR + PATH_SEP + getName(source) - else: - if type == FILE or type == HTTP or type == FTP: - versionCommand = ECHO_BIN +" " + getURL(source) - - - return versionCommand - -################################################################################ -# -# Download Helper Methods -# -################################################################################ - -# -# Download the item specified in source to the given destintation -# -def downloadSource(source, destination): - name = getName(source) - type = getType(source) - url = getValue(source.getElementsByTagName(URL)[0]) - log ( "Retrieving "+ name + "("+ type +")") - - targetdir=_rootDir + PATH_SEP + destination + PATH_SEP + name - - command = "" - - mkdir(targetdir) - - if (os.listdir(targetdir)==[]): - - # Setup command for a fresh checkout - if (type == SVN): - command = SVN_BIN+" co "+url+" "+targetdir - if (source.getElementsByTagName(REVISION).length > 0): - revision = getValue(source.getElementsByTagName(REVISION)[0]) - command = SVN_BIN+" co -r"+revision+" "+url+" "+targetdir - else: - if (type == HTTP): - command = WGET_BIN+" --no-directories -P "+targetdir+" "+url - else: - if (type == FILE): - if url.startswith(HTTP): - command = WGET_BIN+" -P "+targetdir+" "+url - else: - if url.startswith(FTP): - command = WGET_BIN+" -P "+targetdir+" "+url - else: - command = CP_BIN+" -R "+url+" "+targetdir - else: - warn("Target directory(" + targetdir + ") is not empty please ensure contents are valid or run 'clean "+name+"'") - - verbose("Executing:"+command) - log_no_newline("Retrieving "+source.nodeName+": ") - - if (type == FILE): - runCommand(command, True) - else: - runCommand(command, False) - -################################################################################ -# -# Command Helper Methods -# -################################################################################ - -# -# Run command and print out last 20 lines of data on error -# -def runCommandShowError(command): - last20 = runCommand(command, False) - if last20 != None: - lines=last20[0] - lines=lines + 1 - current = 1 - while current != lines: - log (last20[current]) - current = current + 1 - attemptExit(1) - -# -# Runs the given command if showOutput is true then stdout/stderr is shown on screen -# other wise the last 20 lines of output is gathered: -# -# As command runs progress is shown -# -# return array [0] = no of elements in array. Array is fixed size 21 elements but not all are used. FIXME: this is poor -# -# TODO: Current mechanism for limiting to 20 lines is poor, potential to replace usages of this -# method with runCommandWithOutput below -# -def runCommand(command, showOutput): - debug("Running Command:"+command) - try: - if showOutput: - # Process that shows the output - result = Popen(command, shell=True) - else: - # consume the output ourselves - result = Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - - index=0 - last20=[""] * 21 - line = result.stdout.readline() - while (line != "" ): - logWaiting() - - #Record last 20 lines of output - index = index + 1 - if index == 20: - index = 1 - - last20[index]=line - - # process nextline - line = result.stdout.readline() - - # - # If we didn't get any standard or fill our buffers then fill the end of the buffer with any stderr - # - if index == 0 | index < 15 : - line = result.stderr.readline() - - if index != 0: - index = index + 1 - if line != "": - last20[index]="STDERR" - reset = index - while (line != "" ): - logWaiting() - - #Record last 20 lines of output - index = index + 1 - if index == 20: - index = reset - - last20[index]=line - - # process nextline - line = result.stderr.readline() - - result.wait() - - if result.returncode == 0: - logWaitingDone() - else: - logWaitingFailed("Failed") - attemptExit(1) - if not showOutput: - last20[0]=index - return last20 - - return None - - except IOError: - logWaitingFailed ("Error running command.") - attemptExit(1) - -# -# Runs the given command if showOutput is true then stdout/stderr is shown on screen -# Stdout and stderr is gathered up and returned with error code. -# -# return (result.returncode, stdout, stderr) -# -# As command runs progress is shown -# -def runCommandWithOutput(command): - - result = Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - - - # Retrieve STDOUT - stdout=[] - line = result.stdout.readline() - while (line != "" ): - logWaiting() - - stdout.append(line) - - # process nextline - line = result.stdout.readline() - - line = result.stderr.readline() - - # Retrieve STDERR - stderr=[] - while (line != "" ): - stderr.append(line) - - # process nextline - line = result.stderr.readline() - - result.wait() - - logWaitingClear() - - return (result.returncode, stdout, stderr) - - -################################################################################ -# -# OS Helper Methods -# -################################################################################ - -# -# Check _ignoreErrors value and exit if false -# -def attemptExit(code): - if not _ignoreErrors: - sys.exit(code) - else: - print ("Ignoring Errors") - -# -# Check that the required binaries are present for this tool. -# Only checks the minimum set. -# Logs warning if archive tools are missing -# -def checkSystemRequirements(): - exists = checkExists(SVN_BIN) - exists = exists & checkExists(WGET_BIN) - exists = exists & checkExists(CP_BIN) - exists = exists & checkExists(PATCH_BIN) - exists = exists & checkExists(FILE_BIN) - - if not checkExists(TAR_BIN): - warn("Unable to process tar files as tar binary does not exist:" + TAR_BIN) - if not checkExists(BZIP2_BIN): - warn("Unable to process bzip2 files as bzip2 binary does not exist:" + BZIP2_BIN) - if not checkExists(UNZIP_BIN): - warn("Unable to process zip files as unzip binary does not exist:" + UNZIP_BIN) - - if not exists: - sys.exit(1) - -# -# Helper that checks for files existence -# -def checkExists(command): - debug_no_newline("Checking for "+command+":") - command = LS_BIN+" "+command - - result = Popen(command, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, - stderr=subprocess.PIPE) - line = result.stdout.readline() - - while (line != "" ): - # process nextline - line = result.stdout.readline() - - result.wait() - - if result.returncode == 0: - debug("OK") - return True - else: - debug("Missing") - warn("Missing dependancy:"+command) - return False - - -# Delete everything reachable from the directory named in 'top', -# assuming there are no symbolic links. -# -# If an attempt to delete '/' is performed this is logged as a fatal error -# -def deleteDir(top): - if top == '/': - fatal("Exiting as attempt to delete '/' occured.") - else: - if (os.path.exists(top)): - log_no_newline("Removing:"+top+". ") - for root, dirs, files in os.walk(top, topdown=False): - logWaiting() - for name in files: - os.remove(os.path.join(root, name)) - for name in dirs: - logWaiting() - os.rmdir(os.path.join(root, name)) - - logWaiting() - os.rmdir(top) - - logWaitingDone() - -def mkdir(dir): - if not os.path.exists(dir): - os.mkdir(dir) - - -################################################################################ -# -# Logging Helper Methods -# -################################################################################ - -# -# Provide a spinning -/|\ -# -def logWaiting(): - global _charIndex, _waitingChars - - _charIndex = (_charIndex + 1) % len(_waitingChars) - - log_no_newline('\b') - log_no_newline(_waitingChars[_charIndex]) - -# -# Clear the logWaiting symbol and end the line with ' Done' -# -def logWaitingDone(): - log_no_newline('\b') - log(" Done") - -# -# Clear the logWaiting symbol -# -def logWaitingClear(): - log_no_newline('\b') - -# -# Clear the logWaiting symbol and end line with messsage -# -def logWaitingFailed(message): - log_no_newline('\b') - log(" "+message) - -def debug(string): - if _debug: - log(string) - -def verbose(string): - if _verbose: - log(string) - -def log (string): - if _log: - print string - -def warn (string): - print string - -def fatal(string): - print string - attemptExit(1) - -def log_no_newline (string): - if _log: - sys.stdout.write(string) - sys.stdout.flush() - -def verbose_no_newline (string): - if _verbose: - sys.stdout.write(string) - sys.stdout.flush() - -def debug_no_newline (string): - if _debug: - sys.stdout.write(string) - sys.stdout.flush() - -if __name__ == "__main__": - main() diff --git a/qpid/buildtools/buildCreator/qpid.build b/qpid/buildtools/buildCreator/qpid.build deleted file mode 100644 index f55025dc8d..0000000000 --- a/qpid/buildtools/buildCreator/qpid.build +++ /dev/null @@ -1,55 +0,0 @@ -<!-- - - - - 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. - - - --> -<builds> - <build> - <name>qpid-build</name> - - <dependency> - <source>qpid</source> - </dependency> - - <targets> - <build> - <script><![CDATA[ - -pushd $qpid/java -ant -Dproject.version=$version build - -]]> - </script> - </build> - - <release> - <script><![CDATA[ -# Create build package -mkdir -p $release/$build-$version -cp -r $qpid/java/build/* $release/$build-$version - -# Build release artifact -cd $release -tar cvzf $build-$version.tgz $build-$version -]]> - </script> - </release> - </targets> - - </build> -</builds> diff --git a/qpid/doc/book/.gitignore b/qpid/cpp/docs/book/.gitignore index 21f1f20096..21f1f20096 100644 --- a/qpid/doc/book/.gitignore +++ b/qpid/cpp/docs/book/.gitignore diff --git a/qpid/doc/book/Makefile b/qpid/cpp/docs/book/Makefile index 6e97a0c5cc..6e97a0c5cc 100644 --- a/qpid/doc/book/Makefile +++ b/qpid/cpp/docs/book/Makefile diff --git a/qpid/doc/book/src/Makefile.inc b/qpid/cpp/docs/book/src/Makefile.inc index 4de5733740..4de5733740 100644 --- a/qpid/doc/book/src/Makefile.inc +++ b/qpid/cpp/docs/book/src/Makefile.inc diff --git a/qpid/doc/book/src/common/css/style.css b/qpid/cpp/docs/book/src/common/css/style.css index c681596592..c681596592 100644 --- a/qpid/doc/book/src/common/css/style.css +++ b/qpid/cpp/docs/book/src/common/css/style.css diff --git a/qpid/doc/book/src/cpp-broker/.gitignore b/qpid/cpp/docs/book/src/cpp-broker/.gitignore index 6d31bdba7f..6d31bdba7f 100644 --- a/qpid/doc/book/src/cpp-broker/.gitignore +++ b/qpid/cpp/docs/book/src/cpp-broker/.gitignore diff --git a/qpid/doc/book/src/cpp-broker/AMQP-Compatibility.xml b/qpid/cpp/docs/book/src/cpp-broker/AMQP-Compatibility.xml index e5aa98cf96..e5aa98cf96 100644 --- a/qpid/doc/book/src/cpp-broker/AMQP-Compatibility.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/AMQP-Compatibility.xml diff --git a/qpid/doc/book/src/cpp-broker/AMQP-Messaging-Broker-CPP-Book.xml b/qpid/cpp/docs/book/src/cpp-broker/AMQP-Messaging-Broker-CPP-Book.xml index 6122b12e18..6122b12e18 100644 --- a/qpid/doc/book/src/cpp-broker/AMQP-Messaging-Broker-CPP-Book.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/AMQP-Messaging-Broker-CPP-Book.xml diff --git a/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml b/qpid/cpp/docs/book/src/cpp-broker/Active-Passive-Cluster.xml index 461b75d320..461b75d320 100644 --- a/qpid/doc/book/src/cpp-broker/Active-Passive-Cluster.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/Active-Passive-Cluster.xml diff --git a/qpid/doc/book/src/cpp-broker/Cheat-Sheet-for-configuring-Exchange-Options.xml b/qpid/cpp/docs/book/src/cpp-broker/Cheat-Sheet-for-configuring-Exchange-Options.xml index fccdae1b9a..fccdae1b9a 100644 --- a/qpid/doc/book/src/cpp-broker/Cheat-Sheet-for-configuring-Exchange-Options.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/Cheat-Sheet-for-configuring-Exchange-Options.xml diff --git a/qpid/doc/book/src/cpp-broker/Cheat-Sheet-for-configuring-Queue-Options.xml b/qpid/cpp/docs/book/src/cpp-broker/Cheat-Sheet-for-configuring-Queue-Options.xml index 125372e463..125372e463 100644 --- a/qpid/doc/book/src/cpp-broker/Cheat-Sheet-for-configuring-Queue-Options.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/Cheat-Sheet-for-configuring-Queue-Options.xml diff --git a/qpid/doc/book/src/cpp-broker/HA-Queue-Replication.xml b/qpid/cpp/docs/book/src/cpp-broker/HA-Queue-Replication.xml index 81b55a3914..81b55a3914 100644 --- a/qpid/doc/book/src/cpp-broker/HA-Queue-Replication.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/HA-Queue-Replication.xml diff --git a/qpid/doc/book/src/cpp-broker/LVQ.xml b/qpid/cpp/docs/book/src/cpp-broker/LVQ.xml index b57c6268be..b57c6268be 100644 --- a/qpid/doc/book/src/cpp-broker/LVQ.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/LVQ.xml diff --git a/qpid/doc/book/src/cpp-broker/Makefile b/qpid/cpp/docs/book/src/cpp-broker/Makefile index 0266a0f54d..0266a0f54d 100644 --- a/qpid/doc/book/src/cpp-broker/Makefile +++ b/qpid/cpp/docs/book/src/cpp-broker/Makefile diff --git a/qpid/doc/book/src/cpp-broker/Managing-CPP-Broker.xml b/qpid/cpp/docs/book/src/cpp-broker/Managing-CPP-Broker.xml index ab72bf286b..ab72bf286b 100644 --- a/qpid/doc/book/src/cpp-broker/Managing-CPP-Broker.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/Managing-CPP-Broker.xml diff --git a/qpid/doc/book/src/cpp-broker/QMF-Python-Console-Tutorial.xml b/qpid/cpp/docs/book/src/cpp-broker/QMF-Python-Console-Tutorial.xml index 2cb802671b..2cb802671b 100644 --- a/qpid/doc/book/src/cpp-broker/QMF-Python-Console-Tutorial.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/QMF-Python-Console-Tutorial.xml diff --git a/qpid/doc/book/src/cpp-broker/Qpid-Interoperability-Documentation.xml b/qpid/cpp/docs/book/src/cpp-broker/Qpid-Interoperability-Documentation.xml index 74546693df..74546693df 100644 --- a/qpid/doc/book/src/cpp-broker/Qpid-Interoperability-Documentation.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/Qpid-Interoperability-Documentation.xml diff --git a/qpid/doc/book/src/cpp-broker/Qpid-Management-Framework.xml b/qpid/cpp/docs/book/src/cpp-broker/Qpid-Management-Framework.xml index 89bfe9d95e..89bfe9d95e 100644 --- a/qpid/doc/book/src/cpp-broker/Qpid-Management-Framework.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/Qpid-Management-Framework.xml diff --git a/qpid/doc/book/src/cpp-broker/Running-CPP-Broker.xml b/qpid/cpp/docs/book/src/cpp-broker/Running-CPP-Broker.xml index 7f76cbc354..7f76cbc354 100644 --- a/qpid/doc/book/src/cpp-broker/Running-CPP-Broker.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/Running-CPP-Broker.xml diff --git a/qpid/doc/book/src/cpp-broker/Security.xml b/qpid/cpp/docs/book/src/cpp-broker/Security.xml index 8f42e6abdf..8f42e6abdf 100644 --- a/qpid/doc/book/src/cpp-broker/Security.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/Security.xml diff --git a/qpid/doc/book/src/cpp-broker/Using-Broker-Federation.xml b/qpid/cpp/docs/book/src/cpp-broker/Using-Broker-Federation.xml index 614c168704..614c168704 100644 --- a/qpid/doc/book/src/cpp-broker/Using-Broker-Federation.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/Using-Broker-Federation.xml diff --git a/qpid/doc/book/src/cpp-broker/Using-message-groups.xml b/qpid/cpp/docs/book/src/cpp-broker/Using-message-groups.xml index 9b904d9f18..9b904d9f18 100644 --- a/qpid/doc/book/src/cpp-broker/Using-message-groups.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/Using-message-groups.xml diff --git a/qpid/doc/book/src/cpp-broker/producer-flow-control.xml b/qpid/cpp/docs/book/src/cpp-broker/producer-flow-control.xml index fd44f51e81..fd44f51e81 100644 --- a/qpid/doc/book/src/cpp-broker/producer-flow-control.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/producer-flow-control.xml diff --git a/qpid/doc/book/src/cpp-broker/queue-state-replication.xml b/qpid/cpp/docs/book/src/cpp-broker/queue-state-replication.xml index 3ffac805eb..3ffac805eb 100644 --- a/qpid/doc/book/src/cpp-broker/queue-state-replication.xml +++ b/qpid/cpp/docs/book/src/cpp-broker/queue-state-replication.xml diff --git a/qpid/doc/book/src/images/qpid-logo.png b/qpid/cpp/docs/book/src/images/qpid-logo.png Binary files differindex 5f4ccc3081..5f4ccc3081 100644 --- a/qpid/doc/book/src/images/qpid-logo.png +++ b/qpid/cpp/docs/book/src/images/qpid-logo.png diff --git a/qpid/doc/book/src/old/ACL.xml b/qpid/cpp/docs/book/src/old/ACL.xml index ceb7cecb23..ceb7cecb23 100644 --- a/qpid/doc/book/src/old/ACL.xml +++ b/qpid/cpp/docs/book/src/old/ACL.xml diff --git a/qpid/doc/book/src/old/AMQP-.NET-Messaging-Client.xml b/qpid/cpp/docs/book/src/old/AMQP-.NET-Messaging-Client.xml index 1d4001942b..1d4001942b 100644 --- a/qpid/doc/book/src/old/AMQP-.NET-Messaging-Client.xml +++ b/qpid/cpp/docs/book/src/old/AMQP-.NET-Messaging-Client.xml diff --git a/qpid/doc/book/src/old/AMQP-C++-Messaging-Client.xml b/qpid/cpp/docs/book/src/old/AMQP-C++-Messaging-Client.xml index 73a2cd6c0b..73a2cd6c0b 100644 --- a/qpid/doc/book/src/old/AMQP-C++-Messaging-Client.xml +++ b/qpid/cpp/docs/book/src/old/AMQP-C++-Messaging-Client.xml diff --git a/qpid/doc/book/src/old/AMQP-Java-JMS-Messaging-Client.xml b/qpid/cpp/docs/book/src/old/AMQP-Java-JMS-Messaging-Client.xml index 8c14d67e14..8c14d67e14 100644 --- a/qpid/doc/book/src/old/AMQP-Java-JMS-Messaging-Client.xml +++ b/qpid/cpp/docs/book/src/old/AMQP-Java-JMS-Messaging-Client.xml diff --git a/qpid/doc/book/src/old/AMQP-Messaging-Broker-CPP.xml b/qpid/cpp/docs/book/src/old/AMQP-Messaging-Broker-CPP.xml index b4e0deb13d..b4e0deb13d 100644 --- a/qpid/doc/book/src/old/AMQP-Messaging-Broker-CPP.xml +++ b/qpid/cpp/docs/book/src/old/AMQP-Messaging-Broker-CPP.xml diff --git a/qpid/doc/book/src/old/AMQP-Python-Messaging-Client.xml b/qpid/cpp/docs/book/src/old/AMQP-Python-Messaging-Client.xml index 15baf214ec..15baf214ec 100644 --- a/qpid/doc/book/src/old/AMQP-Python-Messaging-Client.xml +++ b/qpid/cpp/docs/book/src/old/AMQP-Python-Messaging-Client.xml diff --git a/qpid/doc/book/src/old/AMQP-Ruby-Messaging-Client.xml b/qpid/cpp/docs/book/src/old/AMQP-Ruby-Messaging-Client.xml index 45318c0beb..45318c0beb 100644 --- a/qpid/doc/book/src/old/AMQP-Ruby-Messaging-Client.xml +++ b/qpid/cpp/docs/book/src/old/AMQP-Ruby-Messaging-Client.xml diff --git a/qpid/doc/book/src/old/AMQP.xml b/qpid/cpp/docs/book/src/old/AMQP.xml index 1a609649bb..1a609649bb 100644 --- a/qpid/doc/book/src/old/AMQP.xml +++ b/qpid/cpp/docs/book/src/old/AMQP.xml diff --git a/qpid/doc/book/src/old/Binding-URL-Format.xml b/qpid/cpp/docs/book/src/old/Binding-URL-Format.xml index 3d938b740a..3d938b740a 100644 --- a/qpid/doc/book/src/old/Binding-URL-Format.xml +++ b/qpid/cpp/docs/book/src/old/Binding-URL-Format.xml diff --git a/qpid/doc/book/src/old/Book-Info.xml b/qpid/cpp/docs/book/src/old/Book-Info.xml index 2e02fbe8ea..2e02fbe8ea 100644 --- a/qpid/doc/book/src/old/Book-Info.xml +++ b/qpid/cpp/docs/book/src/old/Book-Info.xml diff --git a/qpid/doc/book/src/old/Book.xml b/qpid/cpp/docs/book/src/old/Book.xml index ee69532152..ee69532152 100644 --- a/qpid/doc/book/src/old/Book.xml +++ b/qpid/cpp/docs/book/src/old/Book.xml diff --git a/qpid/doc/book/src/old/Broker-CPP.xml b/qpid/cpp/docs/book/src/old/Broker-CPP.xml index 99584be23d..99584be23d 100644 --- a/qpid/doc/book/src/old/Broker-CPP.xml +++ b/qpid/cpp/docs/book/src/old/Broker-CPP.xml diff --git a/qpid/doc/book/src/old/Broker-Java.xml b/qpid/cpp/docs/book/src/old/Broker-Java.xml index f8ce89b185..f8ce89b185 100644 --- a/qpid/doc/book/src/old/Broker-Java.xml +++ b/qpid/cpp/docs/book/src/old/Broker-Java.xml diff --git a/qpid/doc/book/src/old/Clients.xml b/qpid/cpp/docs/book/src/old/Clients.xml index 3dc2d38e86..3dc2d38e86 100644 --- a/qpid/doc/book/src/old/Clients.xml +++ b/qpid/cpp/docs/book/src/old/Clients.xml diff --git a/qpid/doc/book/src/old/Connection-URL-Format.xml b/qpid/cpp/docs/book/src/old/Connection-URL-Format.xml index cb772487cd..cb772487cd 100644 --- a/qpid/doc/book/src/old/Connection-URL-Format.xml +++ b/qpid/cpp/docs/book/src/old/Connection-URL-Format.xml diff --git a/qpid/doc/book/src/old/Download.xml b/qpid/cpp/docs/book/src/old/Download.xml index 7bc08143ac..7bc08143ac 100644 --- a/qpid/doc/book/src/old/Download.xml +++ b/qpid/cpp/docs/book/src/old/Download.xml diff --git a/qpid/doc/book/src/old/Excel-AddIn.xml b/qpid/cpp/docs/book/src/old/Excel-AddIn.xml index e38f620bd8..e38f620bd8 100644 --- a/qpid/doc/book/src/old/Excel-AddIn.xml +++ b/qpid/cpp/docs/book/src/old/Excel-AddIn.xml diff --git a/qpid/doc/book/src/old/FAQ.xml b/qpid/cpp/docs/book/src/old/FAQ.xml index 5647f18f69..5647f18f69 100644 --- a/qpid/doc/book/src/old/FAQ.xml +++ b/qpid/cpp/docs/book/src/old/FAQ.xml diff --git a/qpid/doc/book/src/old/Getting-Started.xml b/qpid/cpp/docs/book/src/old/Getting-Started.xml index 216a52170e..216a52170e 100644 --- a/qpid/doc/book/src/old/Getting-Started.xml +++ b/qpid/cpp/docs/book/src/old/Getting-Started.xml diff --git a/qpid/doc/book/src/old/How-to-Use-JNDI.xml b/qpid/cpp/docs/book/src/old/How-to-Use-JNDI.xml index 0d6315c2a3..0d6315c2a3 100644 --- a/qpid/doc/book/src/old/How-to-Use-JNDI.xml +++ b/qpid/cpp/docs/book/src/old/How-to-Use-JNDI.xml diff --git a/qpid/doc/book/src/old/InfoPlugin.xml b/qpid/cpp/docs/book/src/old/InfoPlugin.xml index aebcd08c02..aebcd08c02 100644 --- a/qpid/doc/book/src/old/InfoPlugin.xml +++ b/qpid/cpp/docs/book/src/old/InfoPlugin.xml diff --git a/qpid/doc/book/src/old/Introduction.xml b/qpid/cpp/docs/book/src/old/Introduction.xml index 8f92c207cf..8f92c207cf 100644 --- a/qpid/doc/book/src/old/Introduction.xml +++ b/qpid/cpp/docs/book/src/old/Introduction.xml diff --git a/qpid/doc/book/src/old/Java-Broker-StatusLogMessages.xml b/qpid/cpp/docs/book/src/old/Java-Broker-StatusLogMessages.xml index 98f876e532..98f876e532 100644 --- a/qpid/doc/book/src/old/Java-Broker-StatusLogMessages.xml +++ b/qpid/cpp/docs/book/src/old/Java-Broker-StatusLogMessages.xml diff --git a/qpid/doc/book/src/old/Java-JMS-Selector-Syntax.xml b/qpid/cpp/docs/book/src/old/Java-JMS-Selector-Syntax.xml index 870e277b66..870e277b66 100644 --- a/qpid/doc/book/src/old/Java-JMS-Selector-Syntax.xml +++ b/qpid/cpp/docs/book/src/old/Java-JMS-Selector-Syntax.xml diff --git a/qpid/doc/book/src/old/Management-Design-notes.xml b/qpid/cpp/docs/book/src/old/Management-Design-notes.xml index 76f0dac926..76f0dac926 100644 --- a/qpid/doc/book/src/old/Management-Design-notes.xml +++ b/qpid/cpp/docs/book/src/old/Management-Design-notes.xml diff --git a/qpid/doc/book/src/old/NET-User-Guide.xml b/qpid/cpp/docs/book/src/old/NET-User-Guide.xml index 7bfa20b8c8..7bfa20b8c8 100644 --- a/qpid/doc/book/src/old/NET-User-Guide.xml +++ b/qpid/cpp/docs/book/src/old/NET-User-Guide.xml diff --git a/qpid/doc/book/src/old/PythonBrokerTest.xml b/qpid/cpp/docs/book/src/old/PythonBrokerTest.xml index ae7edade40..ae7edade40 100644 --- a/qpid/doc/book/src/old/PythonBrokerTest.xml +++ b/qpid/cpp/docs/book/src/old/PythonBrokerTest.xml diff --git a/qpid/doc/book/src/old/QMan-Qpid-Management-bridge.xml b/qpid/cpp/docs/book/src/old/QMan-Qpid-Management-bridge.xml index f2c366dcbb..f2c366dcbb 100644 --- a/qpid/doc/book/src/old/QMan-Qpid-Management-bridge.xml +++ b/qpid/cpp/docs/book/src/old/QMan-Qpid-Management-bridge.xml diff --git a/qpid/doc/book/src/old/Qpid-ACLs.xml b/qpid/cpp/docs/book/src/old/Qpid-ACLs.xml index a2b64061c3..a2b64061c3 100644 --- a/qpid/doc/book/src/old/Qpid-ACLs.xml +++ b/qpid/cpp/docs/book/src/old/Qpid-ACLs.xml diff --git a/qpid/doc/book/src/old/Qpid-Book.xml b/qpid/cpp/docs/book/src/old/Qpid-Book.xml index ee69532152..ee69532152 100644 --- a/qpid/doc/book/src/old/Qpid-Book.xml +++ b/qpid/cpp/docs/book/src/old/Qpid-Book.xml diff --git a/qpid/doc/book/src/old/Qpid-Compatibility-And-Interoperability-Book.xml b/qpid/cpp/docs/book/src/old/Qpid-Compatibility-And-Interoperability-Book.xml index f382f390c7..f382f390c7 100644 --- a/qpid/doc/book/src/old/Qpid-Compatibility-And-Interoperability-Book.xml +++ b/qpid/cpp/docs/book/src/old/Qpid-Compatibility-And-Interoperability-Book.xml diff --git a/qpid/doc/book/src/old/SASL-Compatibility.xml b/qpid/cpp/docs/book/src/old/SASL-Compatibility.xml index ad223792b5..ad223792b5 100644 --- a/qpid/doc/book/src/old/SASL-Compatibility.xml +++ b/qpid/cpp/docs/book/src/old/SASL-Compatibility.xml diff --git a/qpid/doc/book/src/old/SSL.xml b/qpid/cpp/docs/book/src/old/SSL.xml index a9a5cb953a..a9a5cb953a 100644 --- a/qpid/doc/book/src/old/SSL.xml +++ b/qpid/cpp/docs/book/src/old/SSL.xml diff --git a/qpid/doc/book/src/old/Security-Plugins.xml b/qpid/cpp/docs/book/src/old/Security-Plugins.xml index bf5cb726b3..bf5cb726b3 100644 --- a/qpid/doc/book/src/old/Security-Plugins.xml +++ b/qpid/cpp/docs/book/src/old/Security-Plugins.xml diff --git a/qpid/doc/book/src/old/System-Properties.xml b/qpid/cpp/docs/book/src/old/System-Properties.xml index 40b823185f..40b823185f 100644 --- a/qpid/doc/book/src/old/System-Properties.xml +++ b/qpid/cpp/docs/book/src/old/System-Properties.xml diff --git a/qpid/doc/book/src/old/Using-Qpid-with-other-JNDI-Providers.xml b/qpid/cpp/docs/book/src/old/Using-Qpid-with-other-JNDI-Providers.xml index 2bd7d761ef..2bd7d761ef 100644 --- a/qpid/doc/book/src/old/Using-Qpid-with-other-JNDI-Providers.xml +++ b/qpid/cpp/docs/book/src/old/Using-Qpid-with-other-JNDI-Providers.xml diff --git a/qpid/doc/book/src/old/WCF.xml b/qpid/cpp/docs/book/src/old/WCF.xml index aaf54463db..aaf54463db 100644 --- a/qpid/doc/book/src/old/WCF.xml +++ b/qpid/cpp/docs/book/src/old/WCF.xml diff --git a/qpid/doc/book/src/old/schemas.xml b/qpid/cpp/docs/book/src/old/schemas.xml index 6102e65f07..6102e65f07 100644 --- a/qpid/doc/book/src/old/schemas.xml +++ b/qpid/cpp/docs/book/src/old/schemas.xml diff --git a/qpid/doc/book/src/programming/Makefile b/qpid/cpp/docs/book/src/programming/Makefile index 0266a0f54d..0266a0f54d 100644 --- a/qpid/doc/book/src/programming/Makefile +++ b/qpid/cpp/docs/book/src/programming/Makefile diff --git a/qpid/doc/book/src/programming/Message-Groups-Guide.xml b/qpid/cpp/docs/book/src/programming/Message-Groups-Guide.xml index 0ec6982bac..0ec6982bac 100644 --- a/qpid/doc/book/src/programming/Message-Groups-Guide.xml +++ b/qpid/cpp/docs/book/src/programming/Message-Groups-Guide.xml diff --git a/qpid/doc/book/src/programming/Programming-In-Apache-Qpid.xml b/qpid/cpp/docs/book/src/programming/Programming-In-Apache-Qpid.xml index 8bd9225fb2..8bd9225fb2 100644 --- a/qpid/doc/book/src/programming/Programming-In-Apache-Qpid.xml +++ b/qpid/cpp/docs/book/src/programming/Programming-In-Apache-Qpid.xml diff --git a/qpid/doc/book/src/qmf/QmfBook.xml b/qpid/cpp/docs/book/src/qmf/QmfBook.xml index 64a6545fb5..64a6545fb5 100644 --- a/qpid/doc/book/src/qmf/QmfBook.xml +++ b/qpid/cpp/docs/book/src/qmf/QmfBook.xml diff --git a/qpid/doc/book/src/qmf/QmfIntroduction.xml b/qpid/cpp/docs/book/src/qmf/QmfIntroduction.xml index db7b8949a5..db7b8949a5 100644 --- a/qpid/doc/book/src/qmf/QmfIntroduction.xml +++ b/qpid/cpp/docs/book/src/qmf/QmfIntroduction.xml diff --git a/qpid/doc/book/xsl/html-custom.xsl b/qpid/cpp/docs/book/xsl/html-custom.xsl index dbfbcc44c7..dbfbcc44c7 100644 --- a/qpid/doc/book/xsl/html-custom.xsl +++ b/qpid/cpp/docs/book/xsl/html-custom.xsl diff --git a/qpid/packaging/windows/INSTALL_NOTES.html b/qpid/cpp/packaging/windows/INSTALL_NOTES.html index 03ac200685..03ac200685 100644 --- a/qpid/packaging/windows/INSTALL_NOTES.html +++ b/qpid/cpp/packaging/windows/INSTALL_NOTES.html diff --git a/qpid/packaging/windows/LICENSE.rtf b/qpid/cpp/packaging/windows/LICENSE.rtf index 04fddfe8b6..04fddfe8b6 100644 --- a/qpid/packaging/windows/LICENSE.rtf +++ b/qpid/cpp/packaging/windows/LICENSE.rtf diff --git a/qpid/packaging/windows/build_installer.bat b/qpid/cpp/packaging/windows/build_installer.bat index addc33f32b..addc33f32b 100644 --- a/qpid/packaging/windows/build_installer.bat +++ b/qpid/cpp/packaging/windows/build_installer.bat diff --git a/qpid/packaging/windows/installer.proj b/qpid/cpp/packaging/windows/installer.proj index d42d6ad9d4..d42d6ad9d4 100644 --- a/qpid/packaging/windows/installer.proj +++ b/qpid/cpp/packaging/windows/installer.proj diff --git a/qpid/packaging/windows/qpid-icon.ico b/qpid/cpp/packaging/windows/qpid-icon.ico Binary files differindex 112f5d8f1f..112f5d8f1f 100644 --- a/qpid/packaging/windows/qpid-icon.ico +++ b/qpid/cpp/packaging/windows/qpid-icon.ico diff --git a/qpid/packaging/windows/qpid-install-background.bmp b/qpid/cpp/packaging/windows/qpid-install-background.bmp Binary files differindex 7a287f107f..7a287f107f 100644 --- a/qpid/packaging/windows/qpid-install-background.bmp +++ b/qpid/cpp/packaging/windows/qpid-install-background.bmp diff --git a/qpid/packaging/windows/qpid-install-banner.bmp b/qpid/cpp/packaging/windows/qpid-install-banner.bmp Binary files differindex 73184a9235..73184a9235 100644 --- a/qpid/packaging/windows/qpid-install-banner.bmp +++ b/qpid/cpp/packaging/windows/qpid-install-banner.bmp diff --git a/qpid/packaging/windows/qpidc.wxs b/qpid/cpp/packaging/windows/qpidc.wxs index d249423c99..d249423c99 100644 --- a/qpid/packaging/windows/qpidc.wxs +++ b/qpid/cpp/packaging/windows/qpidc.wxs diff --git a/qpid/doc/dev-readme/QPID-Component-README.odg b/qpid/doc/dev-readme/QPID-Component-README.odg Binary files differdeleted file mode 100644 index 217a6d68d8..0000000000 --- a/qpid/doc/dev-readme/QPID-Component-README.odg +++ /dev/null diff --git a/qpid/doc/dev-readme/QPID-Component-README.pdf b/qpid/doc/dev-readme/QPID-Component-README.pdf Binary files differdeleted file mode 100644 index 3012372889..0000000000 --- a/qpid/doc/dev-readme/QPID-Component-README.pdf +++ /dev/null diff --git a/qpid/doc/dev-readme/README.txt b/qpid/doc/dev-readme/README.txt deleted file mode 100644 index 65a8626e53..0000000000 --- a/qpid/doc/dev-readme/README.txt +++ /dev/null @@ -1,6 +0,0 @@ -This directory holds documents of interest to developers. - -The documents are descriptions of how Qpid is organized at the source code -level and not of how Qpid works as a delivered product. They provide -supporting graphics and illustrations for top-level README.txt files -located elsewhere in the source tree. diff --git a/qpid/doc/website/README.txt b/qpid/doc/website/README.txt deleted file mode 100644 index dcb3b423e5..0000000000 --- a/qpid/doc/website/README.txt +++ /dev/null @@ -1,10 +0,0 @@ -To edit the website, check out the /site repo area: - - svn co https://svn.apache.org/repos/asf/qpid/site - -The HTML files for the site reside in the docs directory, where a README -can be found to describe the process of adding new content. - -It is no longer necessary to generate the main website pages, the live files -are now edited directly, and are deployed to the web server after check in. - diff --git a/qpid/etc/LICENSE b/qpid/etc/LICENSE deleted file mode 100644 index bc46b77047..0000000000 --- a/qpid/etc/LICENSE +++ /dev/null @@ -1,206 +0,0 @@ -========================================================================= -== Apache License == -========================================================================= - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/qpid/etc/NOTICE b/qpid/etc/NOTICE deleted file mode 100644 index 05f39ba176..0000000000 --- a/qpid/etc/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ -// ------------------------------------------------------------------ -// NOTICE file corresponding to the section 4d of The Apache License, -// Version 2.0, in this case for Qpid bin scripts -// ------------------------------------------------------------------ - -Apache Qpid -Copyright 2006-2008 Apache Software Foundation - diff --git a/qpid/etc/svn-auto-props b/qpid/etc/svn-auto-props deleted file mode 100644 index 35f1d10998..0000000000 --- a/qpid/etc/svn-auto-props +++ /dev/null @@ -1,77 +0,0 @@ -# -# -# 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. -# -# -### Section for configuring miscelleneous Subversion options. -[miscellany] -### Set enable-auto-props to 'yes' to enable automatic properties -### for 'svn add' and 'svn import', it defaults to 'no'. -### Automatic properties are defined in the section 'auto-props'. -enable-auto-props = yes - -### Section for configuring automatic properties. -### The format of the entries is: -### file-name-pattern = propname[=value][;propname[=value]...] -### The file-name-pattern can contain wildcards (such as '*' and -### '?'). All entries which match will be applied to the file. -### Note that auto-props functionality must be enabled, which -### is typically done by setting the 'enable-auto-props' option. -[auto-props] -*.java = svn:eol-style=native;svn:keywords=Rev Date -*.xml = svn:mime-type=text/xml;svn:eol-style=native;svn:keywords=Rev Date -*.xsl = svn:mime-type=text/xml;svn:eol-style=native;svn:keywords=Rev Date -*.xsd = svn:mime-type=text/xml;svn:eol-style=native;svn:keywords=Rev Date -*.xjb = svn:mime-type=text/xml;svn:eol-style=native;svn:keywords=Rev Date -*.wsdl = svn:mime-type=text/xml;svn:eol-style=native;svn:keywords=Rev Date -*.properties = svn:mime-type=text/plain;svn:eol-style=native;svn:keywords=Rev Date -.checkstyle = svn:mime-type=text/xml;svn:eol-style=native;svn:keywords=Rev Date -.pmd = svn:mime-type=text/xml;svn:eol-style=native;svn:keywords=Rev Date -.ruleset = svn:mime-type=text/xml;svn:eol-style=native;svn:keywords=Rev Date -*.c = svn:eol-style=native;svn:keywords=Rev Date -*.cpp = svn:eol-style=native;svn:keywords=Rev Date -*.h = svn:eol-style=native;svn:keywords=Rev Date -*.dsp = svn:eol-style=CRLF -*.dsw = svn:eol-style=CRLF -*.sh = svn:eol-style=native;svn:executable -*.bat = svn:eol-style=native -*.pl = svn:eol-style=native -*.py = svn:eol-style=native -*.cmd = svn:eol-style=native -*.txt = svn:eol-style=native;svn:mime-type=text/plain -*.cat = svn:eol-style=native;svn:mime-type=text/plain -*.htm* = svn:eol-style=native;svn:mime-type=text/html;svn:keywords=Rev Date -ChangeLog = svn:eol-style=native;svn:mime-type=text/plain -README* = svn:eol-style=native;svn:mime-type=text/plain -LICENSE* = svn:eol-style=native;svn:mime-type=text/plain -NOTICE* = svn:eol-style=native;svn:mime-type=text/plain -TODO* = svn:eol-style=native;svn:mime-type=text/plain -KEYS* = svn:eol-style=native;svn:mime-type=text/plain -INSTALL* = svn:eol-style=native;svn:mime-type=text/plain -WHATSNEW* = svn:eol-style=native;svn:mime-type=text/plain -NEWS* = svn:eol-style=native;svn:mime-type=text/plain -COPYING = svn:eol-style=native;svn:mime-type=text/plain -*.png = svn:mime-type=image/png -*.jpg = svn:mime-type=image/jpeg -*.gif = svn:mime-type=image/gif -Makefile = svn:eol-style=native -*.css = svn:eol-style=native -*.js = svn:eol-style=native -*.jsx = svn:eol-style=native -*.py = svn:eol-style=native -*.rb = svn:eol-style=native diff --git a/qpid/extras/dispatch/README b/qpid/extras/dispatch/README deleted file mode 100644 index 24cba9ed6e..0000000000 --- a/qpid/extras/dispatch/README +++ /dev/null @@ -1,4 +0,0 @@ -The Qpid Dispatch source tree has been moved to a new location. It can now be found in: - - http://svn.apache.org/repos/asf/qpid/dispatch/trunk - diff --git a/qpid/review/LICENSE b/qpid/review/LICENSE deleted file mode 100644 index bc46b77047..0000000000 --- a/qpid/review/LICENSE +++ /dev/null @@ -1,206 +0,0 @@ -========================================================================= -== Apache License == -========================================================================= - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/qpid/review/NOTICE b/qpid/review/NOTICE deleted file mode 100644 index 54c534c30b..0000000000 --- a/qpid/review/NOTICE +++ /dev/null @@ -1,8 +0,0 @@ -// ------------------------------------------------------------------ -// NOTICE file corresponding to the section 4d of The Apache License, -// Version 2.0, in this case for Qpid code review scripts -// ------------------------------------------------------------------ - -Apache Qpid -Copyright 2006-2008 Apache Software Foundation - diff --git a/qpid/review/agenda.py b/qpid/review/agenda.py deleted file mode 100755 index 6ad20362cb..0000000000 --- a/qpid/review/agenda.py +++ /dev/null @@ -1,84 +0,0 @@ -#!/usr/bin/env python -# -# -# 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. - -import sys, re -from popen2 import popen2, popen3 -from optparse import OptionParser -from xml.dom.minidom import parse, parseString - -prereqs = ["tr", "svn", "xsltproc", "sed", "grep", "wget"] - -svncmd = "svn log https://svn.apache.org/repos/asf/qpid/trunk/qpid/java --xml -r %s:HEAD | tr '\\n\\r|' ' -' | xsltproc svnlog2wiki.xsl - | grep r | sed -e 's/^ *//' | sed -e 's/\\(QPID-[0-9]*\\)/\\[\\1 | https:\\/\\/issues.apache.org\\/jira\\/browse\\/\\1 \]/g'" - -jiracmd = "wget -q -O - http://issues.apache.org/jira/sr/jira.issueviews:searchrequest-xml/12312564/SearchRequest-12312564.xml?tempMax=1000 | tr '[]|' '()-' | xsltproc jiraRSS2wiki.xsl - | grep '|' | sed -e 's/^ *//'" - - -def get_commits(revision): - (stdout, stdin) = popen2(svncmd % revision) - return add_jira_status(stdout.read()) - -def add_jira_status(commits): - commit_lines = commits.split("\n") - new_commits = [] - for commit in commit_lines: - if re.match(".*https://issues.apache.org/.*", commit): - jira = re.findall("QPID-[0-9]*", commit)[0] - jira_xml_url = "http://issues.apache.org/jira/si/jira.issueviews:issue-xml/%s/%s.xml" % (jira, jira) - (stdout, stdin) = popen2("wget -q -O - %s" % jira_xml_url) - - jira_dom = parse(stdout) - status = jira_dom.getElementsByTagName("status")[0] - new_commits.append("%s %s | " % (commit, status.lastChild.data)) - else: - new_commits.append(commit) - - return "\n".join(new_commits) - - -def get_jiras(): - (stdout, stdin) = popen2(jiracmd) - return stdout.read() - -def main(): - parser = OptionParser() - parser.add_option("-r", "--revision", dest="revision", action="store", - type="string", - help="The first revision to generate logs for") - - (options, args) = parser.parse_args() - - # Check that we have what's necessary - - notfound = re.compile('^which') - for cmd in prereqs: - (stdout, stdin, stderr) = popen3('which %s' % cmd) - if (notfound.match(stderr.read())): - parser.error ("Could not find command %s, try [apt-get|yum] install %s" % - (cmd, cmd)) - - if (options.revision == None): - parser.error("svn revision must be specified") - - print(get_commits(options.revision)) - print "h2. Jiras" - print(get_jiras()) - -if __name__ == "__main__": - main() diff --git a/qpid/review/changeLogToWiki.py b/qpid/review/changeLogToWiki.py deleted file mode 100755 index 4054b135df..0000000000 --- a/qpid/review/changeLogToWiki.py +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env python -# -# -# 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. - -import sys, re -from popen2 import popen2, popen3 -from optparse import OptionParser -from xml.dom.minidom import parse, parseString - -prereqs = ["tr", "svn", "xsltproc", "sed", "grep", "wget"] - -apacheSVN="https://svn.apache.org/repos/asf/qpid/trunk/qpid/java" - -svncmd = "svn log %s --xml -r %s:HEAD | tr '\\n\\r|' ' -' | xsltproc svnlog2wiki.xsl - | grep r | sed -e 's/^ *//' | sed -e 's/\\(QPID-[0-9]*\\)/\\[\\1 | https:\\/\\/issues.apache.org\\/jira\\/browse\\/\\1 \]/g'" - - -def get_commits(revision): - (stdout, stdin) = popen2(svncmd % (options.repo,revision)) - return add_jira_status(stdout.read()) - -def add_jira_status(commits): - commit_lines = commits.split("\n") - new_commits = [] - for commit in commit_lines: - if re.match(".*https://issues.apache.org/.*", commit): - jira = re.findall("QPID-[0-9]*", commit)[0] - jira_xml_url = "http://issues.apache.org/jira/si/jira.issueviews:issue-xml/%s/%s.xml" % (jira, jira) - (stdout, stdin) = popen2("wget -q -O - %s" % jira_xml_url) - - jira_dom = parse(stdout) - status = jira_dom.getElementsByTagName("status")[0] - new_commits.append("%s %s | " % (commit, status.lastChild.data)) - else: - new_commits.append(commit) - - return "\n".join(new_commits) - - -def main(): - global options - parser = OptionParser() - parser.add_option("-r", "--revision", dest="revision", action="store", - type="string", - help="The first revision to generate logs for") - - parser.add_option("-s", "--svn-repo", dest="repo", action="store", - default=apacheSVN, - type="string", - help="Provide a svn repository to process") - - - (options, args) = parser.parse_args() - - # Check that we have what's necessary - - notfound = re.compile('^which') - for cmd in prereqs: - (stdout, stdin, stderr) = popen3('which %s' % cmd) - if (notfound.match(stderr.read())): - parser.error ("Could not find command %s, try [apt-get|yum] install %s" % - (cmd, cmd)) - - if (options.revision == None): - parser.error("svn revision must be specified") - - print(get_commits(options.revision)) - -if __name__ == "__main__": - main() diff --git a/qpid/review/jiraRSS2wiki.xsl b/qpid/review/jiraRSS2wiki.xsl deleted file mode 100644 index bd4933cfb4..0000000000 --- a/qpid/review/jiraRSS2wiki.xsl +++ /dev/null @@ -1,37 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - - - 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. - - - --> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="text"></xsl:output> - <xsl:template match="/"> - || Key || Component(s) || Affects Version/s|| Summary || Status || Assignee || Reporter || Review Comments || - <xsl:apply-templates select="rss/channel/item"></xsl:apply-templates> - </xsl:template> - <xsl:template match="item"> - | [<xsl:value-of select="key"/> | <![CDATA[https://issues.apache.org/jira/browse/]]><xsl:value-of select="key"/> ] | <xsl:apply-templates select="component"/> | <xsl:apply-templates select="version"/> | <xsl:value-of select="title"/> | <xsl:value-of select="status"/> | <xsl:value-of select="assignee"/> | <xsl:value-of select="reporter"/> | | - </xsl:template> - <xsl:template match="component"> -<xsl:value-of select="."/><xsl:if test="following-sibling::node()[name() = 'component']">, </xsl:if> - </xsl:template> - <xsl:template match="version"> - <xsl:value-of select="."/><xsl:if test="following-sibling::node()[name() = 'version']">, </xsl:if> - </xsl:template> -</xsl:stylesheet> diff --git a/qpid/review/svnlog2wiki.xsl b/qpid/review/svnlog2wiki.xsl deleted file mode 100644 index 8fe2fbf033..0000000000 --- a/qpid/review/svnlog2wiki.xsl +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - - - - 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. - - - --> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - <xsl:output method="text"></xsl:output> - <xsl:template match="/"> -|| revision || committer || date || comment || review notes || jira status || -<xsl:apply-templates select="log/logentry"></xsl:apply-templates> - </xsl:template> - <xsl:template match="logentry"> - | [r<xsl:value-of select="@revision"/> | <![CDATA[http://svn.apache.org/viewvc/?view=rev&revision=]]><xsl:value-of select="@revision"/> ] | <xsl:value-of select="author"/> | <xsl:value-of select="substring( date, 1, 10 )"/> | <xsl:value-of select="substring(msg, 1, 200)"/><xsl:if test="string-length( msg ) > 200"> ... </xsl:if> | | - </xsl:template> -</xsl:stylesheet> diff --git a/qpid/sandbox/models/fedsim/__init__.py b/qpid/sandbox/models/fedsim/__init__.py deleted file mode 100644 index 63a3f41f28..0000000000 --- a/qpid/sandbox/models/fedsim/__init__.py +++ /dev/null @@ -1,19 +0,0 @@ -# -# 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. -# - diff --git a/qpid/sandbox/models/fedsim/fedsim.py b/qpid/sandbox/models/fedsim/fedsim.py deleted file mode 100644 index edb6c4c8ed..0000000000 --- a/qpid/sandbox/models/fedsim/fedsim.py +++ /dev/null @@ -1,434 +0,0 @@ -# -# 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. -# - -class Sim: - def __init__(self): - self.brokers = {} - self.clients = {} - self.errors = 0 - self.warnings = 0 - - def error(self, text): - self.errors += 1 - print "###### Error:", text - - def warning(self, text): - self.warnings += 1 - print "###### Warning:", text - - def end(self): - print "========================" - print "Errors: %d, Warnings: %d" % (self.errors, self.warnings) - print "========================" - - def dumpState(self): - print "============================" - print "===== Federation State =====" - print "============================" - for broker in self.brokers: - for exchange in self.brokers[broker].exchanges: - print "Exchange %s.%s" % (broker, exchange) - for key in self.brokers[broker].exchanges[exchange].keys: - print " Key %s" % key - for queue in self.brokers[broker].exchanges[exchange].keys[key]: - print " Queue %s origins=%s" % \ - (queue.name, self.brokers[broker].exchanges[exchange].keys[key][queue].originList) - - def addBroker(self, name): - if name in self.brokers: - raise Exception("Broker of same name already exists") - broker = Broker(self, name) - self.brokers[name] = broker - return broker - - def addClient(self, name, broker): - if name in self.clients: - raise Exception("Client of same name already exists") - client = Client(self, name, broker) - self.clients[name] = client - return client - - def link(self, left, right, bidir=True): - print "====== link %s to %s, bidir=%s" % (left.tag, right.tag, bidir) - l1 = left.createLink(right) - l1.bridge("amq.direct") - if bidir: - l2 = right.createLink(left) - l2.bridge("amq.direct") - - def bind(self, client, key): - print "====== bind Client(%s): k=%s" % (client.name, key) - client.bind(key) - - def unbind(self, client, key): - print "====== unbind Client(%s): k=%s" % (client.name, key) - client.unbind(key) - - def sendMessage(self, key, broker, body="Message Body"): - print "====== sendMessage: broker=%s k=%s" % (broker.tag, key) - msg = Message(key, body) - exchange = broker.exchanges["amq.direct"] - for client in self.clients: - self.clients[client].expect(key); - exchange.receive(key, msg, True) - for client in self.clients: - self.clients[client].checkReception() - - -class Destination: - def receive(self, key, msg, fromUser=False): - pass - - -class Client(Destination): - def __init__(self, sim, name, broker): - self.sim = sim - self.name = name - self.broker = broker - self.broker.connect(self) - self.queue = self.broker.declare_queue(name) - self.subscription = self.broker.subscribe(self, name) - self.expected = None - self.boundKeys = [] - - def bind(self, key): - self.boundKeys.append(key) - self.broker.bind("amq.direct", self.name, key) - - def unbind(self, key): - self.boundKeys.remove(key) - self.broker.unbind("amq.direct", self.name, key) - - def receive(self, key, msg, fromUser=False): - print "Client(%s) received [%s]: %s" % (self.name, key, msg.body) - if self.expected == key: - self.expected = None - else: - self.sim.error("Client(%s) received unexpected message with key [%s]" % \ - (self.name, self.expected)) - - def expect(self, key): - if key in self.boundKeys: - self.expected = key - - def checkReception(self): - if self.expected: - self.sim.error("Client(%s) never received message with key [%s]" % \ - (self.name, self.expected)) - -class Broker(Client): - def __init__(self, sim, tag): - self.sim = sim - self.tag = tag - self.connections = {} - self.exchanges = {} - self.queues = {} - self.subscriptions = {} - self.links = {} - self.directExchange = self.declare_exchange("amq.direct") - - def connect(self, client): - if client in self.connections: - raise Exception("Client already connected") - self.connections[client] = Connection(client) - - def declare_queue(self, name, tag=None, exclude=None): - if name in self.queues: - raise Exception("Queue already exists") - self.queues[name] = Queue(self, name, tag, exclude) - - def subscribe(self, dest, queueName): - if queueName not in self.queues: - raise Exception("Queue does not exist") - self.queues[queueName].setDest(dest) - - def declare_exchange(self, name): - if name in self.exchanges: - return - exchange = Exchange(self, name) - self.exchanges[name] = exchange - return exchange - - def bind(self, exchangeName, queueName, key, tagList=[], fedOp=None, origin=None): - if exchangeName not in self.exchanges: - raise Exception("Exchange not found") - if queueName not in self.queues: - raise Exception("Queue not found") - exchange = self.exchanges[exchangeName] - queue = self.queues[queueName] - exchange.bind(queue, key, tagList, fedOp, origin) - - def unbind(self, exchangeName, queueName, key): - if exchangeName not in self.exchanges: - raise Exception("Exchange not found") - if queueName not in self.queues: - raise Exception("Queue not found") - exchange = self.exchanges[exchangeName] - queue = self.queues[queueName] - exchange.unbind(queue, key) - - def createLink(self, other): - if other in self.links: - raise Exception("Peer broker already linked") - link = Link(self, other) - self.links[other] = link - return link - - -class Connection: - def __init__(self, client): - self.client = client - - -class Exchange(Destination): - def __init__(self, broker, name): - self.broker = broker - self.sim = broker.sim - self.name = name - self.keys = {} - self.bridges = [] - - def bind(self, queue, key, tagList, fedOp, origin): - if not fedOp: fedOp = "bind" - print "Exchange(%s.%s) bind q=%s, k=%s, tags=%s, op=%s, origin=%s" % \ - (self.broker.tag, self.name, queue.name, key, tagList, fedOp, origin), - - if self.broker.tag in tagList: - print "(tag ignored)" - return - - if fedOp == "bind" or fedOp == "unbind": - if key not in self.keys: - self.keys[key] = {} - queueMap = self.keys[key] - - if fedOp == "bind": - ## - ## Add local or federation binding case - ## - if queue in queueMap: - if origin and origin in queueMap[queue].originList: - print "(dup ignored)" - elif origin: - queueMap[queue].originList.append(origin) - print "(origin added)" - else: - binding = Binding(origin) - queueMap[queue] = binding - print "(binding added)" - - elif fedOp == "unbind": - ## - ## Delete federation binding case - ## - if queue in queueMap: - binding = queueMap[queue] - if origin and origin in binding.originList: - binding.originList.remove(origin) - if len(binding.originList) == 0: - queueMap.pop(queue) - if len(queueMap) == 0: - self.keys.pop(key) - print "(last origin del)" - else: - print "(removed origin)" - else: - print "(origin not found)" - else: - print "(queue not found)" - - elif fedOp == "reorigin": - print "(ok)" - self.reorigin() - - elif fedOp == "hello": - print "(ok)" - - else: - raise Exception("Unknown fed-opcode '%s'" % fedOp) - - newTagList = [] - newTagList.append(self.broker.tag) - for tag in tagList: - newTagList.append(tag) - if origin: - propOrigin = origin - else: - propOrigin = self.broker.tag - - for bridge in self.bridges: - if bridge.isDynamic(): - bridge.propagate(key, newTagList, fedOp, propOrigin) - - def reorigin(self): - myTag = [] - myTag.append(self.broker.tag) - for key in self.keys: - queueMap = self.keys[key] - found = False - for queue in queueMap: - binding = queueMap[queue] - if binding.isLocal(): - found = True - if found: - for bridge in self.bridges: - if bridge.isDynamic(): - bridge.propagate(key, myTag, "bind", self.broker.tag) - - def unbind(self, queue, key): - print "Exchange(%s.%s) unbind q=%s, k=%s" % (self.broker.tag, self.name, queue.name, key), - if key not in self.keys: - print "(key not known)" - return - queueMap = self.keys[key] - if queue not in queueMap: - print "(queue not bound)" - return - queueMap.pop(queue) - if len(queueMap) == 0: - self.keys.pop(key) - print "(ok, remove bound-key)" - else: - print "(ok)" - - count = 0 - for queue in queueMap: - if len(queueMap[queue].originList) == 0: - count += 1 - - if count == 0: - myTag = [] - myTag.append(self.broker.tag) - for bridge in self.bridges: - if bridge.isDynamic(): - bridge.propagate(key, myTag, "unbind", self.broker.tag) - - def receive(self, key, msg, fromUser=False): - sent = False - if key in self.keys: - queueMap = self.keys[key] - for queue in queueMap: - if queue.enqueue(msg): - sent = True - if not sent and not fromUser: - self.sim.warning("Exchange(%s.%s) received unroutable message: k=%s" % \ - (self.broker.tag, self.name, key)) - - def addDynamicBridge(self, bridge): - if bridge in self.bridges: - raise Exception("Dynamic bridge already added to exchange") - self.bridges.append(bridge) - - for b in self.bridges: - if b != bridge: - b.sendReorigin() - self.reorigin() - -class Queue: - def __init__(self, broker, name, tag=None, exclude=None): - self.broker = broker - self.name = name - self.tag = tag - self.exclude = exclude - self.dest = None - - def setDest(self, dest): - self.dest = dest - - def enqueue(self, msg): - print "Queue(%s.%s) rcvd k=%s, tags=%s" % (self.broker.tag, self.name, msg.key, msg.tags), - if self.dest == None: - print "(dropped, no dest)" - return False - if self.exclude and msg.tagFound(self.exclude): - print "(dropped, tag)" - return False - if self.tag: - msg.appendTag(self.tag) - print "(ok)" - self.dest.receive(msg.key, msg) - return True - - -class Binding: - def __init__(self, origin): - self.originList = [] - if origin: - self.originList.append(origin) - - def isLocal(self): - return len(self.originList) == 0 - - -class Link: - def __init__(self, local, remote): - self.local = local - self.remote = remote - self.remote.connect(self) - self.bridges = [] - - def bridge(self, exchangeName): - bridge = Bridge(self, exchangeName) - - -class Bridge: - def __init__(self, link, exchangeName): - self.link = link - self.exchangeName = exchangeName - if self.exchangeName not in link.local.exchanges: - raise Exception("Exchange not found") - self.exchange = link.local.exchanges[self.exchangeName] - self.queueName = "bridge." + link.local.tag - self.link.remote.declare_queue(self.queueName, self.link.remote.tag, self.link.local.tag) - self.link.remote.subscribe(self.exchange, self.queueName) - self.exchange.addDynamicBridge(self) - - def isDynamic(self): - return True - - def localTag(self): - return self.link.local.tag - - def remoteTag(self): - return self.link.remote.tag - - def propagate(self, key, tagList, fedOp, origin): - if self.link.remote.tag not in tagList: - self.link.remote.bind(self.exchangeName, self.queueName, key, tagList, fedOp, origin) - - def sendReorigin(self): - myTag = [] - myTag.append(self.link.local.tag) - self.link.remote.bind(self.exchangeName, self.queueName, "", myTag, "reorigin", "") - - -class Message: - def __init__(self, key, body): - self.key = key - self.body = body - self.tags = [] - - def appendTag(self, tag): - if tag not in self.tags: - self.tags.append(tag) - - def tagFound(self, tag): - return tag in self.tags - - diff --git a/qpid/sandbox/models/fedsim/testBig.py b/qpid/sandbox/models/fedsim/testBig.py deleted file mode 100644 index 416a086983..0000000000 --- a/qpid/sandbox/models/fedsim/testBig.py +++ /dev/null @@ -1,88 +0,0 @@ -# -# 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. -# - -from fedsim import Sim - -sim = Sim() -b1 = sim.addBroker("B1") -b2 = sim.addBroker("B2") -b3 = sim.addBroker("B3") -b4 = sim.addBroker("B4") -b5 = sim.addBroker("B5") -b6 = sim.addBroker("B6") -b7 = sim.addBroker("B7") -b8 = sim.addBroker("B8") - -c1 = sim.addClient("C1", b1) -c3 = sim.addClient("C3", b3) -c4 = sim.addClient("C4", b4) -c5 = sim.addClient("C5", b5) -c8 = sim.addClient("C8", b8) - -sim.link(b1, b2) -sim.link(b3, b2) -sim.link(b4, b2) -sim.link(b5, b2) - -sim.link(b6, b7) -sim.link(b6, b8) - -sim.bind(c1, "A") -sim.bind(c3, "B") -sim.bind(c8, "A") - -sim.link(b5, b6) - -sim.bind(c4, "A") - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", b3) -sim.sendMessage("A", b4) -sim.sendMessage("A", b5) -sim.sendMessage("A", b6) -sim.sendMessage("A", b7) -sim.sendMessage("A", b8) - -sim.sendMessage("B", b1) -sim.sendMessage("B", b2) -sim.sendMessage("B", b3) -sim.sendMessage("B", b4) -sim.sendMessage("B", b5) -sim.sendMessage("B", b6) -sim.sendMessage("B", b7) -sim.sendMessage("B", b8) - -sim.unbind(c1, "A") - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", b3) -sim.sendMessage("A", b4) -sim.sendMessage("A", b5) -sim.sendMessage("A", b6) -sim.sendMessage("A", b7) -sim.sendMessage("A", b8) - -sim.unbind(c4, "A") -sim.unbind(c3, "B") -sim.unbind(c8, "A") - -sim.dumpState() -sim.end() diff --git a/qpid/sandbox/models/fedsim/testRing.py b/qpid/sandbox/models/fedsim/testRing.py deleted file mode 100644 index c883b54993..0000000000 --- a/qpid/sandbox/models/fedsim/testRing.py +++ /dev/null @@ -1,48 +0,0 @@ -# -# 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. -# - -from fedsim import Sim - -sim = Sim() -b1 = sim.addBroker("B1") -b2 = sim.addBroker("B2") -b3 = sim.addBroker("B3") - -sim.link(b1, b2, False) -sim.link(b2, b3, False) -sim.link(b3, b1, False) - -c1 = sim.addClient("C1", b1) -c2 = sim.addClient("C2", b2) -c3 = sim.addClient("C3", b3) - -sim.bind(c1, "A") -sim.bind(c2, "A") - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", b3) - -sim.unbind(c2, "A") - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", b3) - -sim.end() diff --git a/qpid/sandbox/models/fedsim/testStar.py b/qpid/sandbox/models/fedsim/testStar.py deleted file mode 100644 index e6b801446f..0000000000 --- a/qpid/sandbox/models/fedsim/testStar.py +++ /dev/null @@ -1,65 +0,0 @@ -# -# 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. -# - -from fedsim import Sim - -sim = Sim() -b1 = sim.addBroker("B1") -b2 = sim.addBroker("B2") -b3 = sim.addBroker("B3") -bc = sim.addBroker("BC") - -sim.link(b1, bc) -sim.link(b2, bc) -sim.link(b3, bc) - -c1 = sim.addClient("C1", b1) -c2 = sim.addClient("C2", b2) -c3 = sim.addClient("C3", b3) -cc = sim.addClient("CC", bc) - -sim.bind(c1, "A") - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", b3) -sim.sendMessage("A", bc) - -sim.bind(c2, "A") - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", b3) -sim.sendMessage("A", bc) - -sim.unbind(c1, "A") - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", b3) -sim.sendMessage("A", bc) - -sim.unbind(c2, "A") - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", b3) -sim.sendMessage("A", bc) - -sim.end() diff --git a/qpid/sandbox/models/fedsim/testStarAdd.py b/qpid/sandbox/models/fedsim/testStarAdd.py deleted file mode 100644 index e0eb44952a..0000000000 --- a/qpid/sandbox/models/fedsim/testStarAdd.py +++ /dev/null @@ -1,56 +0,0 @@ -# -# 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. -# - -from fedsim import Sim - -sim = Sim() -b1 = sim.addBroker("B1") -b2 = sim.addBroker("B2") -b3 = sim.addBroker("B3") -bc = sim.addBroker("BC") - -sim.link(b1, bc) -sim.link(b2, bc) - -c1 = sim.addClient("C1", b1) -c2 = sim.addClient("C2", b2) -c3 = sim.addClient("C3", b3) -cc = sim.addClient("CC", bc) - -sim.bind(c1, "A") - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", bc) - -sim.bind(c2, "A") - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", bc) - -sim.bind(c3, "A") -sim.link(b3, bc) - -sim.sendMessage("A", b1) -sim.sendMessage("A", b2) -sim.sendMessage("A", bc) - -sim.end() - diff --git a/qpid/wcf/LICENSE.txt b/qpid/wcf/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/qpid/wcf/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/qpid/wcf/NOTICE.txt b/qpid/wcf/NOTICE.txt deleted file mode 100644 index 41117b0fa0..0000000000 --- a/qpid/wcf/NOTICE.txt +++ /dev/null @@ -1,5 +0,0 @@ -Apache Qpid WCF -Copyright 2009-2014 The Apache Software Foundation - -This product includes software developed at -The Apache Software Foundation (http://www.apache.org/). diff --git a/qpid/wcf/QpidWcf.sln b/qpid/wcf/QpidWcf.sln deleted file mode 100644 index 9e3cc5621e..0000000000 --- a/qpid/wcf/QpidWcf.sln +++ /dev/null @@ -1,89 +0,0 @@ -
-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
-# 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
-#
-
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AmqpTypes", "src\Apache\Qpid\AmqpTypes\AmqpTypes.csproj", "{820BFC34-A40F-46BA-B86B-05334854CA17}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Interop", "src\Apache\Qpid\Interop\Interop.vcproj", "{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}"
- ProjectSection(ProjectDependencies) = postProject
- {820BFC34-A40F-46BA-B86B-05334854CA17} = {820BFC34-A40F-46BA-B86B-05334854CA17}
- EndProjectSection
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Channel", "src\Apache\Qpid\Channel\Channel.csproj", "{8AABAB30-7D1E-4539-B7D1-05450262BAD2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FunctionalTests", "test\Apache\Qpid\Test\Channel\Functional\FunctionalTests.csproj", "{E2D8C779-E417-40BA-BEE1-EE034268482F}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WcfPerfTest", "test\Apache\Qpid\Test\Channel\WcfPerfTest\WcfPerfTest.csproj", "{D0F8FDE4-7AC6-4CFF-986A-50D06F7FD733}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|Win32.Build.0 = Debug|Any CPU
- {820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|x64.ActiveCfg = Debug|Any CPU
- {820BFC34-A40F-46BA-B86B-05334854CA17}.Debug|x64.Build.0 = Debug|Any CPU
- {820BFC34-A40F-46BA-B86B-05334854CA17}.Release|Win32.ActiveCfg = Release|Any CPU
- {820BFC34-A40F-46BA-B86B-05334854CA17}.Release|Win32.Build.0 = Release|Any CPU
- {820BFC34-A40F-46BA-B86B-05334854CA17}.Release|x64.ActiveCfg = Release|Any CPU
- {820BFC34-A40F-46BA-B86B-05334854CA17}.Release|x64.Build.0 = Release|Any CPU
- {C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|Win32.ActiveCfg = Debug|Win32
- {C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|Win32.Build.0 = Debug|Win32
- {C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|x64.ActiveCfg = Debug|x64
- {C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Debug|x64.Build.0 = Debug|x64
- {C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|Win32.ActiveCfg = Release|Win32
- {C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|Win32.Build.0 = Release|Win32
- {C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|x64.ActiveCfg = Release|x64
- {C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}.Release|x64.Build.0 = Release|x64
- {E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|Win32.Build.0 = Debug|Any CPU
- {E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|x64.ActiveCfg = Debug|Any CPU
- {E2D8C779-E417-40BA-BEE1-EE034268482F}.Debug|x64.Build.0 = Debug|Any CPU
- {E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|Win32.ActiveCfg = Release|Any CPU
- {E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|Win32.Build.0 = Release|Any CPU
- {E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|x64.ActiveCfg = Release|Any CPU
- {E2D8C779-E417-40BA-BEE1-EE034268482F}.Release|x64.Build.0 = Release|Any CPU
- {8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|Win32.Build.0 = Debug|Any CPU
- {8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|x64.ActiveCfg = Debug|Any CPU
- {8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Debug|x64.Build.0 = Debug|Any CPU
- {8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|Win32.ActiveCfg = Release|Any CPU
- {8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|Win32.Build.0 = Release|Any CPU
- {8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|x64.ActiveCfg = Release|Any CPU
- {8AABAB30-7D1E-4539-B7D1-05450262BAD2}.Release|x64.Build.0 = Release|Any CPU
- {D0F8FDE4-7AC6-4CFF-986A-50D06F7FD733}.Debug|Win32.ActiveCfg = Debug|Any CPU
- {D0F8FDE4-7AC6-4CFF-986A-50D06F7FD733}.Debug|Win32.Build.0 = Debug|Any CPU
- {D0F8FDE4-7AC6-4CFF-986A-50D06F7FD733}.Debug|x64.ActiveCfg = Debug|Any CPU
- {D0F8FDE4-7AC6-4CFF-986A-50D06F7FD733}.Debug|x64.Build.0 = Debug|Any CPU
- {D0F8FDE4-7AC6-4CFF-986A-50D06F7FD733}.Release|Win32.ActiveCfg = Release|Any CPU
- {D0F8FDE4-7AC6-4CFF-986A-50D06F7FD733}.Release|Win32.Build.0 = Release|Any CPU
- {D0F8FDE4-7AC6-4CFF-986A-50D06F7FD733}.Release|x64.ActiveCfg = Release|Any CPU
- {D0F8FDE4-7AC6-4CFF-986A-50D06F7FD733}.Release|x64.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/qpid/wcf/ReadMe.txt b/qpid/wcf/ReadMe.txt deleted file mode 100644 index b49e1a37ee..0000000000 --- a/qpid/wcf/ReadMe.txt +++ /dev/null @@ -1,189 +0,0 @@ -1. WCF supported features -========================= - -1. WCF service model programming using one way contracts -2. WCF channel model programming using IInputChannel and IOutputChannel based factories -3. Programmatic access to AMQP message properties on WCF messages -4. AMQP version 0-10 (as provided by the Qpid C++ native client library) -5. Shared connections for multiple channels based on binding parameters -6. WCF to WCF applications (using SOAP message encoders) -7. WCF to non-WCF applications (using raw content encoders) -8. Rudimentary AMQP type support for headers (Int and String) -9. Channel functional tests using NUnit -10. Programming samples -11. Prefetch window for inbound messages -12. Full distributed transaction support with single phase optimization. -13. Limited Qpid Messaging address naming for temporary queues and topics -14. TLS/SSL security with username/password credentials - - -2. Planned features (not yet available) -======================================= - -1. Full AMQP type support, including maps and arrays -2. AMQP session-based local transactions. -3. Shared sessions -4. Connection failover with AMQP broker clusters -5. Broker management -6. System logging and tracing -7. CMake build system support - - -3. Prerequisites -================ - -1. Qpid C++ client and common libraries for Windows including BOOST. -Ensure the location of the Boost library (e.g. %BOOST_ROOT%\lib) is -included in your PATH environment variable. - -2. .NET Framework 3.5 SP1 -Install the .NET Framework from http://www.microsoft.com/net/ - -3. Windows SDK -Install the Windows SDK for the version of Windows that you are using -from http://msdn.microsoft.com/en-us/windows/bb980924.aspx - -4. NUnit -Install NUnit from http://www.nunit.org - -NOTE: In the following instructions %QPID_ROOT% refers to the root of -qpid source code location e.g. C:\trunk\qpid - -5. Build Qpid cpp according to the instuctions in INSTALL-WINDOWS. -Build at least the "qpidd", "qpidxarm", "qpidclient" and "qpidcommon" -projects. Optionally build "perftest" for use with the WcfPerftest -interoperability and performance test program. Create an environment -variable called QPID_BUILD_ROOT and store the path to the Qpid build -directory in it. Use the same BOOST_ROOT environment variable for -building both Qpid cpp and WCF related solutions. - - -4. Building the solution file -============================= - -Ensure that BOOST_ROOT and QPID_BUILD_ROOT environment variables are -set as described above. - -Option 1: Using MSBuild - -1. %systemroot%\Microsoft.NET\Framework\v3.5\MSBuild.exe %QPID_ROOT%\wcf\QpidWcf.sln -2. %systemroot%\Microsoft.NET\Framework\v3.5\MSBuild.exe %QPID_ROOT%\wcf\tools\QCreate\QCreate.sln - - -Option 2: Using Visual Studio 2008 (the Professional Edition, Team -System Development Edition, or Team System Team Suite SKU) - -1. Open the solution file QpidWcf.sln in Visual Studio. -2. Make sure that the reference to 'nunit.framework.dll' by the 'FunctionalTests' - project is appropriately resolved. -3. Select the Debug configuration. -3. Right-click the solution file in the Solution Explorer and select 'Build Solution'. -4. Follow the above steps to build %QPID_ROOT%\wcf\tools\QCreate.sln as well. - - -5. Executing tests -================== - -1. Make sure that the batch file - %QPID_ROOT%\wcf\test\Apache\Qpid\Test\Channel\Functional\RunTests.bat has the correct - values for the nunit_exe, qpid_dll_location and configuration_name variables as per - your installation. -2. Start the qpid broker from the qpid build folder e.g. %QPID_BUILD_ROOT%\src\Debug. -3. Execute RunTests.bat from its location e.g. %QPID_ROOT%\wcf\test\Apache\Qpid\Test\Channel\Functional. - - -6. Building and executing samples -================================= - -WCFToWCFDirect - -1. Copy the dlls Apache.Qpid.Channel.dll and Apache.Qpid.Interop.dll that you built - in step 2 to the %QPID_ROOT%\wcf\samples\Channel\WCFToWCFDirect folder. - -2. Build the solution WCFToWCFDirect.sln. - -3. Copy qpidclientd.dll and qpidcommond.dll from the Qpid build folder - e.g. %QPID_ROOT%\cpp\build\src\Debug to the same location as the exe files - e.g. bin\Debug of each of the projects. These dlls are needed at runtime. - -4. Copy qpidclientd.dll and qpidcommond.dll to %QPID_ROOT%\wcf\tools\QCreate\Debug folder. - -5. Start the qpid broker from the qpid build folder e.g. %QPID_ROOT%\cpp\build\src\Debug. - -6. Create queue required using the QCreate tool located at - %QPID_ROOT%\wcf\tools\QCreate\Debug. The syntax is QCreate %QPID_ROOT%. For - this sample you should do - - QCreate amq.direct routing_key message_queue - -7. Start Service.exe from - %QPID_ROOT%\wcf\samples\Channel\WCFToWCFDirect\Service\bin\Debug. - -8. Start Client.exe from - %QPID_ROOT%\wcf\samples\Channel\WCFToWCFDirect\Client\bin\Debug. - - -WCFToWCFPubSub - -1. Copy the dlls Apache.Qpid.Channel.dll and Apache.Qpid.Interop.dll that you built - in step 2 to the %QPID_ROOT%\wcf\samples\Channel\WCFToWCFPubSub folder. - -2. Build the solution WCFToWCFPubSub.sln. - -3. Copy qpidclientd.dll and qpidcommond.dll from the Qpid build folder - e.g. %QPID_ROOT%\cpp\build\src\Debug to the same location as the exe files - e.g. bin\Debug of each of the projects. These dlls are needed at runtime. - -4. Copy qpidclientd.dll and qpidcommond.dll to %QPID_ROOT%\wcf\tools\QCreate\Debug folder. - -5. Start the qpid broker from the qpid build folder e.g. %QPID_ROOT%\cpp\build\src\Debug. - -6. Create queues required using the QCreate tool located at - \wcf\tools\QCreate\Debug. The syntax is QCreate %QPID_ROOT%. For this sample you - should do - - QCreate amq.topic usa.# usa - QCreate amq.topic #.news news - -7. Start Topic_Consumer.exe from - %QPID_ROOT%\wcf\samples\Channel\WCFToWCFPubSub\Topic_Consumer\bin\Debug. - -8. Start Another_Topic_Consumer.exe from - %QPID_ROOT%\wcf\samples\Channel\WCFToWCFPubSub\Another_Topic_Consumer\bin\Debug. - -9. Start Topic_Producer.exe from - %QPID_ROOT%\wcf\samples\Channel\WCFToWCFPubSub\Topic_Producer\bin\Debug. - - -7. Configuring Transaction Support -================================== - -1. Following the instructions in http://support.microsoft.com/kb/817066, update - the MSDTC security settings to allow XA transactions, and create an XADLL - registry entry for "qpidxarm" with string (REG_SZ) value - "c:\actual\path\to\qpidxarm.dll". - -2. Update the PATH environment variable for system programs and services to - include the locations for the Release versions of each following dll: - - Apache.Qpid.Channel.dll - Apache.Qpid.Interop.dll - qpidclient.dll - qpidcommon.dll - boost*.dll - -3. Restart the Distributed Transaction Coordinator service, so that it runs - using the new PATH and MSDTC settings from the previous steps. - - -8. Known Issues -=============== - -1. The AmqpChannelListener is limited to single threaded use and the async methods - throw NotImplementedException. - -2. Failing to close WCF channels after use can sometimes lead to BOOST timeout - exceptions in the finalizer thread. As a workaround, applications should - close all Qpid WCF services, listeners and channel factories before exiting. - - diff --git a/qpid/wcf/samples/Channel/AppConfig/ConfigDemo.cs b/qpid/wcf/samples/Channel/AppConfig/ConfigDemo.cs deleted file mode 100644 index 3a7eaef57f..0000000000 --- a/qpid/wcf/samples/Channel/AppConfig/ConfigDemo.cs +++ /dev/null @@ -1,109 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-
-namespace Apache.Qpid.Samples.Channel.Config
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Configuration;
- using System.Diagnostics;
- using System.IO;
- using System.ServiceModel;
- using System.ServiceModel.Channels;
- using System.ServiceModel.Description;
- using System.Threading;
- using System.Text;
- using System.Xml;
- using Apache.Qpid.Channel;
-
- [ServiceContract]
- public interface IMessageProcessor
- {
- [OperationContract(IsOneWay = true, Action = "Process")]
- void Process(string s);
- }
-
- public class DemoService : IMessageProcessor
- {
- private static ManualResetEvent messageArrived;
-
- public DemoService()
- {
- }
-
- public static ManualResetEvent MessageArrived
- {
- get
- {
- if (messageArrived == null)
- {
- messageArrived = new ManualResetEvent(false);
- }
-
- return messageArrived;
- }
- }
-
- public void Process(string s)
- {
- Console.WriteLine("DemoService got message: {0}", s);
- MessageArrived.Set();
- }
- }
-
-
- public class ConfigDemo
- {
- static string demoQueueName = "wcf_config_demo";
-
- static void BindingDemo(string bindingName, string queueName)
- {
- AmqpBinding binding = new AmqpBinding(bindingName);
-
- Uri inUri = new Uri("amqp:" + queueName);
- EndpointAddress outEndpoint = new EndpointAddress("amqp:amq.direct?routingkey=" + queueName);
-
- ServiceHost serviceHost = new ServiceHost(typeof(DemoService));
- serviceHost.AddServiceEndpoint(typeof(IMessageProcessor), binding, inUri);
- serviceHost.Open();
-
- ChannelFactory<IMessageProcessor> cf = new ChannelFactory<IMessageProcessor>(binding, outEndpoint);
- cf.Open();
- IMessageProcessor proxy = cf.CreateChannel();
-
- // client and service are ready, so send a message
- DemoService.MessageArrived.Reset();
- Console.WriteLine("sending a message via " + bindingName);
- proxy.Process("a sample message via " + bindingName);
-
- // wait until it is safe to close down the service
- DemoService.MessageArrived.WaitOne();
- cf.Close();
- serviceHost.Close();
- }
-
-
- static void Main(string[] mainArgs)
- {
- BindingDemo("amqpSampleBinding", demoQueueName);
- }
- }
-}
diff --git a/qpid/wcf/samples/Channel/AppConfig/ConfigDemo.csproj b/qpid/wcf/samples/Channel/AppConfig/ConfigDemo.csproj deleted file mode 100644 index 41ee6c4f0d..0000000000 --- a/qpid/wcf/samples/Channel/AppConfig/ConfigDemo.csproj +++ /dev/null @@ -1,143 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{46C5594A-3E8C-44AF-8F53-2A3004ED0311}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <RootNamespace>ConfigDemo</RootNamespace>
- <AssemblyName>ConfigDemo</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <PublishUrl>publish\</PublishUrl>
- <Install>true</Install>
- <InstallFrom>Disk</InstallFrom>
- <UpdateEnabled>false</UpdateEnabled>
- <UpdateMode>Foreground</UpdateMode>
- <UpdateInterval>7</UpdateInterval>
- <UpdateIntervalUnits>Days</UpdateIntervalUnits>
- <UpdatePeriodically>false</UpdatePeriodically>
- <UpdateRequired>false</UpdateRequired>
- <MapFileExtensions>true</MapFileExtensions>
- <ApplicationRevision>0</ApplicationRevision>
- <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
- <IsWebBootstrapper>false</IsWebBootstrapper>
- <UseApplicationTrust>false</UseApplicationTrust>
- <BootstrapperEnabled>true</BootstrapperEnabled>
- <StartupObject>Apache.Qpid.Samples.Channel.Config.ConfigDemo</StartupObject>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- <PlatformTarget>AnyCPU</PlatformTarget>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
- <DebugType>pdbonly</DebugType>
- <Optimize>true</Optimize>
- <OutputPath>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
- <DebugSymbols>true</DebugSymbols>
- <OutputPath>bin\x86\Debug\</OutputPath>
- <DefineConstants>DEBUG;TRACE</DefineConstants>
- <DebugType>full</DebugType>
- <PlatformTarget>x86</PlatformTarget>
- <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
- <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
- <OutputPath>bin\x86\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <Optimize>true</Optimize>
- <DebugType>pdbonly</DebugType>
- <PlatformTarget>x86</PlatformTarget>
- <CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
- <CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
- <ErrorReport>prompt</ErrorReport>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Apache.Qpid.Channel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=679e1f50b62dbace, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\src\Apache\Qpid\Channel\bin\Release\Apache.Qpid.Channel.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.configuration" />
- <Reference Include="System.Data" />
- <Reference Include="System.Runtime.Serialization">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel.Web">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Web.Services" />
- <Reference Include="System.XML" />
- </ItemGroup>
- <ItemGroup>
- <BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 2.0 %28x86%29</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.0 %28x86%29</ProductName>
- <Install>false</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
- <Visible>False</Visible>
- <ProductName>.NET Framework 3.5</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
- <Visible>False</Visible>
- <ProductName>Windows Installer 3.1</ProductName>
- <Install>true</Install>
- </BootstrapperPackage>
- </ItemGroup>
- <ItemGroup>
- <None Include="App.config" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="ConfigDemo.cs" />
- </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>
diff --git a/qpid/wcf/samples/Channel/HelloWorld/HelloWorld.cs b/qpid/wcf/samples/Channel/HelloWorld/HelloWorld.cs deleted file mode 100644 index 88cb11038d..0000000000 --- a/qpid/wcf/samples/Channel/HelloWorld/HelloWorld.cs +++ /dev/null @@ -1,119 +0,0 @@ -/*
-* 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.
-*/
-
-/*
- * A simple Hello world program that sends and receives a message
- * to and from an AMQP broker. The text content is sent as UTF8
- * in "raw" form on the wire (so that it matches the C++ client
- * sample).
- *
- * This program requires that the source queue exists and has
- * an explicit or implicit binding to the target. The following
- * commands work in the default case:
- *
- * python qpid-config add queue my_topic_node
- * python qpid-config bind amq.topic my_topic_node "*"
- *
- */
-
-namespace Apache.Qpid.Samples.Channel.HelloWorld
-{
- using System;
- using System.ServiceModel;
- using System.ServiceModel.Channels;
- using System.ServiceModel.Description;
- using System.Text;
- using System.Xml;
- using Apache.Qpid.Channel;
-
- public class HelloWorld
- {
- static void Main(string[] args)
- {
- String broker = "localhost";
- int port = 5672;
- String target = "amq.topic";
- String source = "my_topic_node";
-
- if (args.Length > 0)
- {
- broker = args[0];
- }
-
- if (args.Length > 1)
- {
- port = int.Parse(args[1]);
- }
-
- if (args.Length > 2)
- {
- target = args[2];
- }
-
- if (args.Length > 3)
- {
- source = args[3];
- }
-
- AmqpBinaryBinding binding = new AmqpBinaryBinding();
- binding.BrokerHost = broker;
- binding.BrokerPort = port;
-
- IChannelFactory<IInputChannel> receiverFactory = binding.BuildChannelFactory<IInputChannel>();
- receiverFactory.Open();
- IInputChannel receiver = receiverFactory.CreateChannel(new EndpointAddress("amqp:" + source));
- receiver.Open();
-
- IChannelFactory<IOutputChannel> senderFactory = binding.BuildChannelFactory<IOutputChannel>();
- senderFactory.Open();
- IOutputChannel sender = senderFactory.CreateChannel(new EndpointAddress("amqp:" + target));
- sender.Open();
-
- sender.Send(Message.CreateMessage(MessageVersion.None, "", new HelloWorldBinaryBodyWriter()));
-
- Message message = receiver.Receive();
- XmlDictionaryReader reader = message.GetReaderAtBodyContents();
- while (!reader.HasValue)
- {
- reader.Read();
- }
-
- byte[] binaryContent = reader.ReadContentAsBase64();
- string text = Encoding.UTF8.GetString(binaryContent);
-
- Console.WriteLine(text);
-
- senderFactory.Close();
- receiverFactory.Close();
- }
- }
-
- public class HelloWorldBinaryBodyWriter : BodyWriter
- {
- public HelloWorldBinaryBodyWriter() : base (true) {}
-
- protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
- {
- byte[] binaryContent = Encoding.UTF8.GetBytes("Hello world!");
- writer.WriteStartElement("Binary");
- writer.WriteBase64(binaryContent, 0, binaryContent.Length);
- writer.WriteEndElement();
- }
- }
-}
diff --git a/qpid/wcf/samples/Channel/HelloWorld/HelloWorld.csproj b/qpid/wcf/samples/Channel/HelloWorld/HelloWorld.csproj deleted file mode 100644 index 5d2a8a3e94..0000000000 --- a/qpid/wcf/samples/Channel/HelloWorld/HelloWorld.csproj +++ /dev/null @@ -1,75 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{CCB71C9F-D332-4FD9-9C98-4519BD6498C4}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <RootNamespace>HelloWorld</RootNamespace>
- <AssemblyName>HelloWorld</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>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Apache.Qpid.Channel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=679e1f50b62dbace, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\src\Apache\Qpid\Channel\bin\Release\Apache.Qpid.Channel.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Runtime.Serialization">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.XML" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="HelloWorld.cs" />
- </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>
diff --git a/qpid/wcf/samples/Channel/WCFToWCFDirect/Client/Client.cs b/qpid/wcf/samples/Channel/WCFToWCFDirect/Client/Client.cs deleted file mode 100644 index 93ac97bc66..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFDirect/Client/Client.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - - -namespace Apache.Qpid.Samples.Channel.WCFToWCFDirect -{ - using System; - using System.ServiceModel; - using System.ServiceModel.Channels; - using Apache.Qpid.Channel; - - class Client - { - static void Main(string[] args) - { - try - { - // Create binding for the service endpoint. - CustomBinding amqpBinding = new CustomBinding(); - amqpBinding.Elements.Add(new BinaryMessageEncodingBindingElement()); - amqpBinding.Elements.Add(new AmqpTransportBindingElement()); - - // Create endpoint address. - Uri amqpClientUri = new Uri("amqp:amq.direct?routingkey=routing_key"); - EndpointAddress endpointAddress = new EndpointAddress(amqpClientUri); - - // Create a client with given client endpoint configuration. - ChannelFactory<IHelloService> channelFactory = new ChannelFactory<IHelloService>(amqpBinding, endpointAddress); - IHelloService clientProxy = channelFactory.CreateChannel(); - - Console.WriteLine(); - - string name = "name"; - for (int i = 0; i < 5; i++) - { - Console.WriteLine("Sending message: " + name + (i + 1)); - clientProxy.SayHello(name + (i + 1)); - } - - Console.WriteLine(); - Console.WriteLine("Press <ENTER> to terminate client."); - Console.ReadLine(); - - channelFactory.Close(); - } - catch (Exception e) - { - Console.WriteLine("Exception: {0}", e); - } - } - } -} diff --git a/qpid/wcf/samples/Channel/WCFToWCFDirect/Client/Client.csproj b/qpid/wcf/samples/Channel/WCFToWCFDirect/Client/Client.csproj deleted file mode 100644 index a609ec9828..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFDirect/Client/Client.csproj +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{0CCD5711-2072-47B8-B902-07EC12C04159}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Client</RootNamespace>
- <AssemblyName>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>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Apache.Qpid.Channel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Apache.Qpid.Channel.dll</HintPath>
- <HintPath>..\..\..\..\bin\Apache.Qpid.Channel.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</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="Client.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Service\Service.csproj">
- <Project>{D0A46136-B4E3-4C50-AB6D-FB2BC6683D6E}</Project>
- <Name>Service</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>
\ No newline at end of file diff --git a/qpid/wcf/samples/Channel/WCFToWCFDirect/Client/Properties/AssemblyInfo.cs b/qpid/wcf/samples/Channel/WCFToWCFDirect/Client/Properties/AssemblyInfo.cs deleted file mode 100644 index 414a3b5858..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFDirect/Client/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* -* 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.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("Client")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MSIT")] -[assembly: AssemblyProduct("Client")] -[assembly: AssemblyCopyright("Copyright © MSIT 2009")] -[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("c3743ce0-3054-4188-8cd7-3a22734ee313")] - -// 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")] diff --git a/qpid/wcf/samples/Channel/WCFToWCFDirect/Service/Properties/AssemblyInfo.cs b/qpid/wcf/samples/Channel/WCFToWCFDirect/Service/Properties/AssemblyInfo.cs deleted file mode 100644 index 2b75210ce3..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFDirect/Service/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* -* 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.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("Service")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MSIT")] -[assembly: AssemblyProduct("Service")] -[assembly: AssemblyCopyright("Copyright © MSIT 2009")] -[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("5447546e-8547-4b0c-981a-1757ab8d9ec5")] - -// 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")] diff --git a/qpid/wcf/samples/Channel/WCFToWCFDirect/Service/Service.cs b/qpid/wcf/samples/Channel/WCFToWCFDirect/Service/Service.cs deleted file mode 100644 index 0342097ed9..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFDirect/Service/Service.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - - -namespace Apache.Qpid.Samples.Channel.WCFToWCFDirect -{ - using System; - using System.ServiceModel; - using System.ServiceModel.Description; - using Apache.Qpid.Channel; - - // Define a service contract. - [ServiceContract] - public interface IHelloService - { - [OperationContract(IsOneWay = true, Action="*")] - void SayHello(string name); - } - - // Service class which implements the service contract. - [ServiceBehavior(AddressFilterMode = AddressFilterMode.Any)] - public class HelloService : IHelloService - { - [OperationBehavior] - public void SayHello(string name) - { - Console.WriteLine("Hello " + name); - } - } - - class Service - { - static void Main(string[] args) - { - // Create binding for the service endpoint. - AmqpBinding amqpBinding = new AmqpBinding(); - - // Create ServiceHost. - ServiceHost serviceHost = new ServiceHost(typeof(HelloService), new Uri[] { new Uri("http://localhost:8080/HelloService") }); - - // Add behavior for our MEX endpoint. - ServiceMetadataBehavior mexBehavior = new ServiceMetadataBehavior(); - mexBehavior.HttpGetEnabled = true; - serviceHost.Description.Behaviors.Add(mexBehavior); - - // Add MEX endpoint. - serviceHost.AddServiceEndpoint(typeof(IMetadataExchange), new BasicHttpBinding(), "MEX"); - - // Add AMQP endpoint. - Uri amqpUri = new Uri("amqp:message_queue"); - serviceHost.AddServiceEndpoint(typeof(IHelloService), amqpBinding, amqpUri.ToString()); - - serviceHost.Open(); - - Console.WriteLine(); - Console.WriteLine("The service is ready."); - Console.WriteLine("Press <ENTER> to terminate service."); - Console.WriteLine(); - Console.ReadLine(); - - if (serviceHost.State != CommunicationState.Faulted) - { - serviceHost.Close(); - } - } - } -} diff --git a/qpid/wcf/samples/Channel/WCFToWCFDirect/Service/Service.csproj b/qpid/wcf/samples/Channel/WCFToWCFDirect/Service/Service.csproj deleted file mode 100644 index 09c7265a87..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFDirect/Service/Service.csproj +++ /dev/null @@ -1,86 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{D0A46136-B4E3-4C50-AB6D-FB2BC6683D6E}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Service</RootNamespace>
- <AssemblyName>Service</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>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Apache.Qpid.Channel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Apache.Qpid.Channel.dll</HintPath>
- <HintPath>..\..\..\..\bin\Apache.Qpid.Channel.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Messaging" />
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</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="Service.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </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>
\ No newline at end of file diff --git a/qpid/wcf/samples/Channel/WCFToWCFDirect/WCFToWCFDirect.sln b/qpid/wcf/samples/Channel/WCFToWCFDirect/WCFToWCFDirect.sln deleted file mode 100644 index 6f30a5e053..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFDirect/WCFToWCFDirect.sln +++ /dev/null @@ -1,46 +0,0 @@ -
-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
-# 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
-#
-
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Client", "Client\Client.csproj", "{0CCD5711-2072-47B8-B902-07EC12C04159}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Service", "Service\Service.csproj", "{D0A46136-B4E3-4C50-AB6D-FB2BC6683D6E}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {0CCD5711-2072-47B8-B902-07EC12C04159}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0CCD5711-2072-47B8-B902-07EC12C04159}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0CCD5711-2072-47B8-B902-07EC12C04159}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0CCD5711-2072-47B8-B902-07EC12C04159}.Release|Any CPU.Build.0 = Release|Any CPU
- {D0A46136-B4E3-4C50-AB6D-FB2BC6683D6E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {D0A46136-B4E3-4C50-AB6D-FB2BC6683D6E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {D0A46136-B4E3-4C50-AB6D-FB2BC6683D6E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {D0A46136-B4E3-4C50-AB6D-FB2BC6683D6E}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Another_Topic_Consumer/Another_Topic_Consumer.cs b/qpid/wcf/samples/Channel/WCFToWCFPubSub/Another_Topic_Consumer/Another_Topic_Consumer.cs deleted file mode 100644 index c1e3ebbc88..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Another_Topic_Consumer/Another_Topic_Consumer.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - - -namespace Apache.Qpid.Samples.Channel.WCFToWCFPubSub -{ - using System; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Description; - using Apache.Qpid.Channel; - - class Another_Topic_Consumer - { - static void Main(string[] args) - { - // Create binding for the service endpoint. - CustomBinding amqpBinding = new CustomBinding(); - amqpBinding.Elements.Add(new BinaryMessageEncodingBindingElement()); - amqpBinding.Elements.Add(new AmqpTransportBindingElement()); - - // Create ServiceHost. - ServiceHost serviceHost = new ServiceHost(typeof(HelloService), new Uri[] { new Uri("http://localhost:8080/HelloService2") }); - - // Add behavior for our MEX endpoint. - ServiceMetadataBehavior mexBehavior = new ServiceMetadataBehavior(); - mexBehavior.HttpGetEnabled = true; - serviceHost.Description.Behaviors.Add(mexBehavior); - - // Add MEX endpoint. - serviceHost.AddServiceEndpoint(typeof(IMetadataExchange), new BasicHttpBinding(), "MEX"); - - // Add AMQP endpoint. - Uri amqpUri = new Uri("amqp:news"); - serviceHost.AddServiceEndpoint(typeof(IHelloService), amqpBinding, amqpUri.ToString()); - - serviceHost.Open(); - - Console.WriteLine(); - Console.WriteLine("The consumer is now listening on the queue \"news\"."); - Console.WriteLine("Press <ENTER> to terminate service."); - Console.WriteLine(); - Console.ReadLine(); - - if (serviceHost.State != CommunicationState.Faulted) - { - serviceHost.Close(); - } - } - } -} diff --git a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Another_Topic_Consumer/Another_Topic_Consumer.csproj b/qpid/wcf/samples/Channel/WCFToWCFPubSub/Another_Topic_Consumer/Another_Topic_Consumer.csproj deleted file mode 100644 index 7031740601..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Another_Topic_Consumer/Another_Topic_Consumer.csproj +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{6AC32E9D-EFB2-4DEF-81D7-F70A0D7A606F}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Another_Topic_Consumer</RootNamespace>
- <AssemblyName>Another_Topic_Consumer</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>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Apache.Qpid.Channel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Apache.Qpid.Channel.dll</HintPath>
- <HintPath>..\..\..\..\bin\Apache.Qpid.Channel.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</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="Another_Topic_Consumer.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Topic_Consumer\Topic_Consumer.csproj">
- <Project>{248A3A0B-FDC4-4E70-8428-BE0AF5AB021B}</Project>
- <Name>Topic_Consumer</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>
\ No newline at end of file diff --git a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Another_Topic_Consumer/Properties/AssemblyInfo.cs b/qpid/wcf/samples/Channel/WCFToWCFPubSub/Another_Topic_Consumer/Properties/AssemblyInfo.cs deleted file mode 100644 index 8c22cb6d1f..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Another_Topic_Consumer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* -* 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.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("Another_Topic_Consumer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MSIT")] -[assembly: AssemblyProduct("Another_Topic_Consumer")] -[assembly: AssemblyCopyright("Copyright © MSIT 2009")] -[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("ba584c88-26a8-4910-a9a1-b4632b9adf01")] - -// 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")] diff --git a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Consumer/Properties/AssemblyInfo.cs b/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Consumer/Properties/AssemblyInfo.cs deleted file mode 100644 index 19fea85618..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Consumer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* -* 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.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("Topic_Consumer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MSIT")] -[assembly: AssemblyProduct("Topic_Consumer")] -[assembly: AssemblyCopyright("Copyright © MSIT 2009")] -[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("3facd6d1-f604-4ac9-ace3-7b7acff471eb")] - -// 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")] diff --git a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Consumer/Topic_Consumer.cs b/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Consumer/Topic_Consumer.cs deleted file mode 100644 index c4dd1e2256..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Consumer/Topic_Consumer.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - - -namespace Apache.Qpid.Samples.Channel.WCFToWCFPubSub -{ - using System; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Description; - using Apache.Qpid.Channel; - - // Define a service contract. - [ServiceContract] - public interface IHelloService - { - [OperationContract(IsOneWay = true)] - void SayHello(string name); - } - - // Service class which implements the service contract. - public class HelloService : IHelloService - { - [OperationBehavior] - public void SayHello(string name) - { - Console.WriteLine("Hello " + name); - } - } - - class Consumer - { - static void Main(string[] args) - { - // Create binding for the service endpoint. - CustomBinding amqpBinding = new CustomBinding(); - amqpBinding.Elements.Add(new BinaryMessageEncodingBindingElement()); - amqpBinding.Elements.Add(new AmqpTransportBindingElement()); - - // Create ServiceHost. - ServiceHost serviceHost = new ServiceHost(typeof(HelloService), new Uri[] { new Uri("http://localhost:8080/HelloService1") }); - - // Add behavior for our MEX endpoint. - ServiceMetadataBehavior mexBehavior = new ServiceMetadataBehavior(); - mexBehavior.HttpGetEnabled = true; - serviceHost.Description.Behaviors.Add(mexBehavior); - - // Add MEX endpoint. - serviceHost.AddServiceEndpoint(typeof(IMetadataExchange), new BasicHttpBinding(), "MEX"); - - // Add AMQP endpoint. - Uri amqpUri = new Uri("amqp:usa"); - serviceHost.AddServiceEndpoint(typeof(IHelloService), amqpBinding, amqpUri.ToString()); - - serviceHost.Open(); - - Console.WriteLine(); - Console.WriteLine("The consumer is now listening on the queue \"usa\"."); - Console.WriteLine("Press <ENTER> to terminate service."); - Console.WriteLine(); - Console.ReadLine(); - - if (serviceHost.State != CommunicationState.Faulted) - { - serviceHost.Close(); - } - } - } -} diff --git a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Consumer/Topic_Consumer.csproj b/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Consumer/Topic_Consumer.csproj deleted file mode 100644 index 1d4ffd96bb..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Consumer/Topic_Consumer.csproj +++ /dev/null @@ -1,85 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{248A3A0B-FDC4-4E70-8428-BE0AF5AB021B}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Topic_Consumer</RootNamespace>
- <AssemblyName>Topic_Consumer</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>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Apache.Qpid.Channel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Apache.Qpid.Channel.dll</HintPath>
- <HintPath>..\..\..\..\bin\Apache.Qpid.Channel.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</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="Topic_Consumer.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </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>
\ No newline at end of file diff --git a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Producer/Properties/AssemblyInfo.cs b/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Producer/Properties/AssemblyInfo.cs deleted file mode 100644 index 87310bf92a..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Producer/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* -* 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.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("Topic_Producer")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("MSIT")] -[assembly: AssemblyProduct("Topic_Producer")] -[assembly: AssemblyCopyright("Copyright © MSIT 2009")] -[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("a70e852d-a510-4e00-af72-68bb8547696f")] - -// 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")] diff --git a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Producer/Topic_Producer.cs b/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Producer/Topic_Producer.cs deleted file mode 100644 index e3850eb4c0..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Producer/Topic_Producer.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - - -namespace Apache.Qpid.Samples.Channel.WCFToWCFPubSub -{ - using System; - using System.ServiceModel; - using System.ServiceModel.Channels; - using Apache.Qpid.Channel; - - class Topic_Producer - { - static void Main(string[] args) - { - try - { - // Create binding for the service endpoint. - CustomBinding amqpBinding = new CustomBinding(); - amqpBinding.Elements.Add(new BinaryMessageEncodingBindingElement()); - amqpBinding.Elements.Add(new AmqpTransportBindingElement()); - - // Create endpoint address. - Uri amqpClientUri = new Uri("amqp:amq.topic?routingkey=usa.news"); - EndpointAddress endpointAddress = new EndpointAddress(amqpClientUri); - - // Create a client with given client endpoint configuration. - ChannelFactory<IHelloService> channelFactory = new ChannelFactory<IHelloService>(amqpBinding, endpointAddress); - IHelloService clientProxy = channelFactory.CreateChannel(); - - Console.WriteLine(); - - string name = "name"; - for (int i = 0; i < 5; i++) - { - Console.WriteLine("Sending message: " + name + (i + 1)); - clientProxy.SayHello(name + (i+1)); - } - - Console.WriteLine(); - Console.WriteLine("Press <ENTER> to terminate client."); - Console.ReadLine(); - - channelFactory.Close(); - } - catch (Exception e) - { - Console.WriteLine("Exception: {0}", e); - } - } - } -} diff --git a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Producer/Topic_Producer.csproj b/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Producer/Topic_Producer.csproj deleted file mode 100644 index cd7f79c581..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFPubSub/Topic_Producer/Topic_Producer.csproj +++ /dev/null @@ -1,91 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{67B413EF-3B9C-4988-87DE-0386C209D368}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Topic_Producer</RootNamespace>
- <AssemblyName>Topic_Producer</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>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Apache.Qpid.Channel, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\Apache.Qpid.Channel.dll</HintPath>
- <HintPath>..\..\..\..\bin\Apache.Qpid.Channel.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</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="Topic_Producer.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Topic_Consumer\Topic_Consumer.csproj">
- <Project>{248A3A0B-FDC4-4E70-8428-BE0AF5AB021B}</Project>
- <Name>Topic_Consumer</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>
\ No newline at end of file diff --git a/qpid/wcf/samples/Channel/WCFToWCFPubSub/WCFToWCFPubSub.sln b/qpid/wcf/samples/Channel/WCFToWCFPubSub/WCFToWCFPubSub.sln deleted file mode 100644 index d8a56ea8db..0000000000 --- a/qpid/wcf/samples/Channel/WCFToWCFPubSub/WCFToWCFPubSub.sln +++ /dev/null @@ -1,52 +0,0 @@ -
-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
-# 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
-#
-
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Topic_Consumer", "Topic_Consumer\Topic_Consumer.csproj", "{248A3A0B-FDC4-4E70-8428-BE0AF5AB021B}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Topic_Producer", "Topic_Producer\Topic_Producer.csproj", "{67B413EF-3B9C-4988-87DE-0386C209D368}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Another_Topic_Consumer", "Another_Topic_Consumer\Another_Topic_Consumer.csproj", "{6AC32E9D-EFB2-4DEF-81D7-F70A0D7A606F}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {248A3A0B-FDC4-4E70-8428-BE0AF5AB021B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {248A3A0B-FDC4-4E70-8428-BE0AF5AB021B}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {248A3A0B-FDC4-4E70-8428-BE0AF5AB021B}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {248A3A0B-FDC4-4E70-8428-BE0AF5AB021B}.Release|Any CPU.Build.0 = Release|Any CPU
- {67B413EF-3B9C-4988-87DE-0386C209D368}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {67B413EF-3B9C-4988-87DE-0386C209D368}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {67B413EF-3B9C-4988-87DE-0386C209D368}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {67B413EF-3B9C-4988-87DE-0386C209D368}.Release|Any CPU.Build.0 = Release|Any CPU
- {6AC32E9D-EFB2-4DEF-81D7-F70A0D7A606F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {6AC32E9D-EFB2-4DEF-81D7-F70A0D7A606F}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {6AC32E9D-EFB2-4DEF-81D7-F70A0D7A606F}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {6AC32E9D-EFB2-4DEF-81D7-F70A0D7A606F}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/qpid/wcf/samples/Integration/Drain/Drain.cs b/qpid/wcf/samples/Integration/Drain/Drain.cs deleted file mode 100644 index 7a88494458..0000000000 --- a/qpid/wcf/samples/Integration/Drain/Drain.cs +++ /dev/null @@ -1,146 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Samples.Integration
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.IO;
- using System.ServiceModel;
- using System.ServiceModel.Channels;
- using System.ServiceModel.Description;
- using System.Text;
- using System.Xml;
- using Apache.Qpid.Channel;
- using Apache.Qpid.AmqpTypes;
-
- class Drain
- {
- // delimit multiple values
- private static void Append(StringBuilder sb, string s)
- {
- if (sb.Length > 0)
- {
- sb.Append(", ");
- }
-
- sb.Append(s);
- }
-
- private static string MessagePropertiesAsString(AmqpProperties props)
- {
- StringBuilder sb = new StringBuilder();
-
- if (props.PropertyMap != null)
- {
- foreach (KeyValuePair<string, AmqpType> kvp in props.PropertyMap)
- {
- string propval;
- if (kvp.Value is AmqpString)
- {
- AmqpString amqps = (AmqpString)kvp.Value;
- propval = amqps.Value;
- }
- else
- {
- propval = kvp.Value.ToString();
- }
-
- Append(sb, kvp.Key + ":" + propval);
- }
- }
-
- return sb.ToString();
- }
-
- private static string MessageContentAsString(Message msg, AmqpProperties props)
- {
- // AmqpBinaryBinding provides message content as a single XML "Binary" element
- XmlDictionaryReader reader = msg.GetReaderAtBodyContents();
- while (!reader.HasValue)
- {
- reader.Read();
- if (reader.EOF)
- {
- throw new InvalidDataException("empty reader for message");
- }
- }
-
- byte[] rawdata = reader.ReadContentAsBase64();
-
- string ct = props.ContentType;
- if (ct != null)
- {
- if (ct.Equals("amqp/map"))
- {
- return "mapdata (coming soon)";
- }
- }
-
- return Encoding.UTF8.GetString(rawdata);
- }
-
- static void Main(string[] args)
- {
- try
- {
- Options options = new Options(args);
-
- AmqpBinaryBinding binding = new AmqpBinaryBinding();
- binding.BrokerHost = options.Broker;
- binding.BrokerPort = options.Port;
- binding.TransferMode = TransferMode.Streamed;
-
- IChannelFactory<IInputChannel> factory = binding.BuildChannelFactory<IInputChannel>();
-
- factory.Open();
- try
- {
- System.ServiceModel.EndpointAddress addr = options.Address;
- IInputChannel receiver = factory.CreateChannel(addr);
- receiver.Open();
-
- TimeSpan timeout = options.Timeout;
- System.ServiceModel.Channels.Message message;
-
- while (receiver.TryReceive(timeout, out message))
- {
- AmqpProperties props = (AmqpProperties)message.Properties["AmqpProperties"];
-
- Console.WriteLine("Message(properties=" +
- MessagePropertiesAsString(props) +
- ", content='" +
- MessageContentAsString(message, props) +
- "')");
- }
- }
- finally
- {
- factory.Close();
- }
- }
- catch (Exception e)
- {
- Console.WriteLine("Drain: " + e);
- }
- }
- }
-}
diff --git a/qpid/wcf/samples/Integration/Drain/Drain.csproj b/qpid/wcf/samples/Integration/Drain/Drain.csproj deleted file mode 100644 index 06c32f5064..0000000000 --- a/qpid/wcf/samples/Integration/Drain/Drain.csproj +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{A67D9B60-34A5-462F-84A2-72C22F623749}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <RootNamespace>Drain</RootNamespace>
- <AssemblyName>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>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Apache.Qpid.Channel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=679e1f50b62dbace, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\src\Apache\Qpid\Channel\bin\Release\Apache.Qpid.Channel.dll</HintPath>
- </Reference>
- <Reference Include="Apache.Qpid.Interop, Version=1.0.3796.12140, Culture=neutral, PublicKeyToken=679e1f50b62dbace, processorArchitecture=AMD64">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\src\Apache\Qpid\Channel\bin\Release\Apache.Qpid.Interop.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Runtime.Serialization">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="Drain.cs" />
- <Compile Include="..\Util\Options.cs" />
- </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>
diff --git a/qpid/wcf/samples/Integration/Integration.sln b/qpid/wcf/samples/Integration/Integration.sln deleted file mode 100644 index 59b228e92a..0000000000 --- a/qpid/wcf/samples/Integration/Integration.sln +++ /dev/null @@ -1,46 +0,0 @@ -
-Microsoft Visual Studio Solution File, Format Version 10.00
-
-#
-# 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
-#
-# Visual Studio 2008
-
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Drain", "Drain\Drain.csproj", "{A67D9B60-34A5-462F-84A2-72C22F623749}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spout", "Spout\Spout.csproj", "{347A531B-38DB-4848-9E4D-4E5E7F9C97E7}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {A67D9B60-34A5-462F-84A2-72C22F623749}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {A67D9B60-34A5-462F-84A2-72C22F623749}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {A67D9B60-34A5-462F-84A2-72C22F623749}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {A67D9B60-34A5-462F-84A2-72C22F623749}.Release|Any CPU.Build.0 = Release|Any CPU
- {347A531B-38DB-4848-9E4D-4E5E7F9C97E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {347A531B-38DB-4848-9E4D-4E5E7F9C97E7}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {347A531B-38DB-4848-9E4D-4E5E7F9C97E7}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {347A531B-38DB-4848-9E4D-4E5E7F9C97E7}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/qpid/wcf/samples/Integration/Spout/Spout.cs b/qpid/wcf/samples/Integration/Spout/Spout.cs deleted file mode 100644 index 651566fbd6..0000000000 --- a/qpid/wcf/samples/Integration/Spout/Spout.cs +++ /dev/null @@ -1,109 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Samples.Integration
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.IO;
- using System.ServiceModel;
- using System.ServiceModel.Channels;
- using System.ServiceModel.Description;
- using System.Text;
- using System.Xml;
- using Apache.Qpid.Channel;
- using Apache.Qpid.AmqpTypes;
-
- class Spout
- {
- static void Main(string[] args)
- {
- try
- {
- Options options = new Options(args);
-
- AmqpBinaryBinding binding = new AmqpBinaryBinding();
- binding.BrokerHost = options.Broker;
- binding.BrokerPort = options.Port;
- binding.TransferMode = TransferMode.Streamed;
-
- IChannelFactory<IOutputChannel> factory = binding.BuildChannelFactory<IOutputChannel>();
-
- factory.Open();
- try
- {
- System.ServiceModel.EndpointAddress addr = options.Address;
- IOutputChannel sender = factory.CreateChannel(addr);
- sender.Open();
-
- MyRawBodyWriter.Initialize(options.Content);
- DateTime end = DateTime.Now.Add(options.Timeout);
- System.ServiceModel.Channels.Message message;
-
- for (int count = 0; ((count < options.Count) || (options.Count == 0)) &&
- ((options.Timeout == TimeSpan.Zero) || (end.CompareTo(DateTime.Now) > 0)); count++)
- {
- message = Message.CreateMessage(MessageVersion.None, "", new MyRawBodyWriter());
- AmqpProperties props = new AmqpProperties();
- props.ContentType = "text/plain";
-
- string id = Guid.NewGuid().ToString() + ":" + count;
- props.PropertyMap.Add("spout-id", new AmqpString(id));
-
- message.Properties["AmqpProperties"] = props;
- sender.Send(message);
- }
- }
- finally
- {
- factory.Close();
- }
- }
- catch (Exception e)
- {
- Console.WriteLine("Spout: " + e);
- }
- }
-
-
- public class MyRawBodyWriter : BodyWriter
- {
- static byte[] body;
-
- public MyRawBodyWriter()
- : base(false)
- {
- }
-
- public static void Initialize(String content)
- {
- body = Encoding.UTF8.GetBytes(content);
- }
-
- // invoked by the binary encoder when the message is written
- protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
- {
- writer.WriteStartElement("Binary");
- writer.WriteBase64(body, 0, body.Length);
- }
- }
- }
-}
diff --git a/qpid/wcf/samples/Integration/Spout/Spout.csproj b/qpid/wcf/samples/Integration/Spout/Spout.csproj deleted file mode 100644 index b104000ad2..0000000000 --- a/qpid/wcf/samples/Integration/Spout/Spout.csproj +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{347A531B-38DB-4848-9E4D-4E5E7F9C97E7}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Spout</RootNamespace>
- <AssemblyName>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>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="Apache.Qpid.Channel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=679e1f50b62dbace, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\src\Apache\Qpid\Channel\bin\Release\Apache.Qpid.Channel.dll</HintPath>
- </Reference>
- <Reference Include="Apache.Qpid.Interop, Version=1.0.3796.12140, Culture=neutral, PublicKeyToken=679e1f50b62dbace, processorArchitecture=AMD64">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..\src\Apache\Qpid\Channel\bin\Release\Apache.Qpid.Interop.dll</HintPath>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Runtime.Serialization">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Xml" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="..\Util\Options.cs" />
- <Compile Include="Spout.cs" />
- </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>
diff --git a/qpid/wcf/samples/Integration/Util/Options.cs b/qpid/wcf/samples/Integration/Util/Options.cs deleted file mode 100644 index a929f8f2de..0000000000 --- a/qpid/wcf/samples/Integration/Util/Options.cs +++ /dev/null @@ -1,157 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Samples.Integration
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.IO;
- using System.ServiceModel;
- using System.ServiceModel.Channels;
- using System.ServiceModel.Description;
- using System.Text;
- using System.Xml;
-
- public class Options
- {
- private string broker;
- private int port;
- private int messageCount;
- private EndpointAddress address;
- private TimeSpan timeout;
- private string content;
-
- public Options(string[] args)
- {
- this.broker = "127.0.0.1";
- this.port = 5672;
- this.messageCount = 1;
- this.timeout = TimeSpan.FromSeconds(0);
- Parse(args);
- }
-
- private void Parse(string[] args)
- {
- int argCount = args.Length;
- int current = 0;
- bool typeSelected = false;
-
- while ((current + 1) < argCount)
- {
- string arg = args[current];
- if (arg == "--count")
- {
- arg = args[++current];
- int i = Int32.Parse(arg);
- if (i >= 0)
- {
- this.messageCount = i;
- }
- }
- else if (arg == "--broker")
- {
- this.broker = args[++current];
- }
- else if (arg == "--port")
- {
- arg = args[++current];
- int i = int.Parse(arg);
- if (i > 0)
- {
- this.port = i;
- }
- }
- else if (arg == "--timeout")
- {
- arg = args[++current];
- int i = int.Parse(arg);
- if (i > 0)
- {
- this.timeout = TimeSpan.FromSeconds(i);
- }
- }
-
- else if (arg == "--content")
- {
- this.content = args[++current];
- }
-
- else
- {
- throw new ArgumentException(String.Format("unknown argument \"{0}\"", arg));
- }
-
- current++;
- }
-
- if (current == argCount)
- {
- throw new ArgumentException("missing argument: address");
- }
-
- address = new EndpointAddress("amqp:" + args[current]);
-
- if (timeout < TimeSpan.FromMilliseconds(100))
- {
- // WCF timeout of 0 really means no time for even a single message transfer
- timeout = TimeSpan.FromMilliseconds(100);
- }
- }
-
- public EndpointAddress Address
- {
- get { return this.address; }
- }
-
- public string Broker
- {
- get { return this.broker; }
- }
-
- public string Content
- {
- get
- {
- if (content == null)
- {
- return String.Empty;
- }
- return content;
- }
- }
-
-
- public int Count
- {
- get { return this.messageCount; }
- }
-
- public int Port
- {
- get { return this.port; }
- }
-
- public TimeSpan Timeout
- {
- get { return this.timeout; }
- }
- }
-}
diff --git a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpBoolean.cs b/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpBoolean.cs deleted file mode 100644 index 980ae78361..0000000000 --- a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpBoolean.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.AmqpTypes -{ - using System; - using System.IO; - using System.Collections.Generic; - using System.Text; - - public class AmqpBoolean : AmqpType - { - bool value; - - public AmqpBoolean(bool i) - { - this.value = i; - } - - public override void Encode(byte[] bufer, int offset, int count) - { - throw new NotImplementedException(); - } - - public override int EncodedSize - { - get { throw new NotImplementedException(); } - } - - public override AmqpType Clone() - { - return new AmqpBoolean(this.value); - } - - public bool Value - { - get { return this.value; } - set { this.value = value; } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpInt.cs b/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpInt.cs deleted file mode 100644 index c114e98a71..0000000000 --- a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpInt.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.AmqpTypes -{ - using System; - using System.IO; - using System.Collections.Generic; - using System.Text; - - public class AmqpInt : AmqpType - { - int value; - - public AmqpInt(int i) - { - this.value = i; - } - - public override void Encode(byte[] bufer, int offset, int count) - { - throw new NotImplementedException(); - } - - public override int EncodedSize - { - get { throw new NotImplementedException(); } - } - - public override AmqpType Clone() - { - return new AmqpInt(this.value); - } - - public int Value - { - get { return this.value; } - set { this.value = value; } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpProperties.cs b/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpProperties.cs deleted file mode 100644 index 4099571fe0..0000000000 --- a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpProperties.cs +++ /dev/null @@ -1,301 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.AmqpTypes -{ - using System; - using System.IO; - using System.Collections.Generic; - using System.Text; - - public class AmqpProperties - { - // AMQP 0-10 delivery properties - private bool durable; - private Nullable<TimeSpan> timeToLive; - private string subject; - - // AMQP 0-10 message properties - private string replyToExchange; - private string replyToRoutingKey; - private byte[] userId; - private byte[] correlationId; - private string contentType; - - // for application and vendor properties - Dictionary<String, AmqpType> propertyMap; - - public AmqpProperties() - { - } - - // AMQP 0-10 "message.delivery-properties - internal bool HasDeliveryProperties - { - get - { - return ((this.subject != null) || this.durable || this.timeToLive.HasValue); - } - } - - internal bool HasMappedProperties - { - get - { - if (this.propertyMap != null) - { - if (this.propertyMap.Count > 0) - { - return true; - } - } - - return false; - } - } - - // AMQP 0-10 "message.message-properties" - internal bool HasMessageProperties - { - get - { - if ((this.replyToExchange != null) || - (this.replyToRoutingKey != null) || - (this.userId != null) || - (this.correlationId != null) || - (this.contentType != null)) - { - return true; - } - - if (this.propertyMap == null) - { - return false; - } - - return (this.propertyMap.Count != 0); - } - } - - public Dictionary<String, AmqpType> PropertyMap - { - get - { - if (this.propertyMap == null) - { - this.propertyMap = new Dictionary<string, AmqpType>(); - } - return propertyMap; - } - set { this.propertyMap = value; } - } - - internal bool Empty - { - get - { - if (this.HasDeliveryProperties || this.HasMessageProperties) - { - return true; - } - return false; - } - } - - public string ContentType - { - get { return contentType; } - // TODO: validate - set { contentType = value; } - } - - public byte[] CorrelationId - { - get { return correlationId; } - set - { - if (value != null) - { - if (value.Length > 65535) - { - throw new ArgumentException("CorrelationId too big"); - } - } - correlationId = value; - } - } - - public byte[] UserId - { - get { return userId; } - set - { - if (value != null) - { - if (value.Length > 65535) - { - throw new ArgumentException("UserId too big"); - } - } - userId = value; - } - } - - public TimeSpan? TimeToLive - { - get { return this.timeToLive; } - set { this.timeToLive = value; } - } - - /// <summary> - /// Obsolete: switch to AMQP 1.0 "Subject" naming - /// </summary> - public string RoutingKey - { - get { return this.subject; } - set { this.subject = value; } - } - - public string Subject - { - get { return this.subject; } - set { this.subject = value; } - } - - public string ReplyToExchange - { - get { return this.replyToExchange; } - } - - public string ReplyToRoutingKey - { - get { return this.replyToRoutingKey; } - } - - // this changes from 0-10 to 1.0 - public void SetReplyTo(string exchange, string routingKey) - { - if ((exchange == null && routingKey == null)) - { - throw new ArgumentNullException("SetReplyTo"); - } - - this.replyToExchange = exchange; - this.replyToRoutingKey = routingKey; - } - - public bool Durable - { - get { return durable; } - set { durable = value; } - } - - public void Clear() - { - this.timeToLive = null; - this.subject = null; - this.replyToRoutingKey = null; - this.replyToExchange = null; - this.durable = false; - this.contentType = null; - this.userId = null; - this.correlationId = null; - this.propertyMap = null; - } - - public AmqpProperties Clone() - { - // memberwise clone ok for string, byte[], and value types - AmqpProperties clonedProps = (AmqpProperties)this.MemberwiseClone(); - - // deeper copy for the dictionary - if (this.propertyMap != null) - { - if (this.propertyMap.Count > 0) - { - Dictionary<string, AmqpType> clonedDictionary = new Dictionary<string, AmqpType>(this.propertyMap.Count); - foreach (KeyValuePair<string, AmqpType> original in this.propertyMap) - { - clonedDictionary.Add(original.Key, original.Value.Clone()); - } - - clonedProps.propertyMap = clonedDictionary; - } - else - { - clonedProps.propertyMap = null; - } - } - return clonedProps; - } - - // adds/replaces from the other AmqpProperty object. - // just inserts references, i.e. provides shallow copy semantics (see Clone for deep copy) - public void MergeFrom(AmqpProperties other) - { - if (other.timeToLive.HasValue) - { - this.timeToLive = other.timeToLive; - } - - if ((other.replyToRoutingKey != null) || (other.replyToExchange != null)) - { - this.replyToExchange = other.replyToExchange; - this.replyToRoutingKey = other.replyToRoutingKey; - } - - if (other.subject != null) - { - this.subject = other.subject; - } - - if (other.durable) - { - this.durable = true; - } - - if (other.contentType != null) - { - this.contentType = other.contentType; - } - - if (other.correlationId != null) - { - this.correlationId = other.correlationId; - } - - if (other.userId != null) - { - this.userId = other.userId; - } - - if (other.propertyMap != null) - { - if (other.propertyMap.Count > 0) - { - Dictionary<string, AmqpType> thisMap = this.PropertyMap; - foreach (KeyValuePair<string, AmqpType> kvp in other.propertyMap) - { - thisMap[kvp.Key] = kvp.Value; - } - } - } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpString.cs b/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpString.cs deleted file mode 100644 index 87cebe878c..0000000000 --- a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpString.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.AmqpTypes -{ - using System; - using System.IO; - using System.Collections.Generic; - using System.Text; - - // for big strings: str16 in 0-10 and str32 in 1.0 - - public class AmqpString : AmqpType - { - string value; - Encoding encoding; - - public AmqpString(string s) - { - this.value = s; - this.encoding = Encoding.UTF8; - } - - public AmqpString(string s, Encoding enc) - { - ValidateEncoding(enc); - this.value = s; - this.encoding = enc; - } - - public Encoding Encoding - { - get { return encoding; } - set - { - ValidateEncoding(value); - encoding = value; - } - } - - private void ValidateEncoding(Encoding enc) - { - if (value == null) - { - throw new ArgumentNullException("Encoding"); - } - - if ((enc != Encoding.UTF8) && (enc != Encoding.Unicode)) - { - throw new ArgumentException("Encoding not one of UTF8 or Unicode"); - } - } - - public override void Encode(byte[] bufer, int offset, int count) - { - throw new NotImplementedException(); - } - - public override int EncodedSize - { - get { throw new NotImplementedException(); } - } - - public override AmqpType Clone() - { - return new AmqpString(this.value); - } - - public string Value - { - get { return this.value; } - set { this.value = value; } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpType.cs b/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpType.cs deleted file mode 100644 index 8cd3ac9e4a..0000000000 --- a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpType.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.AmqpTypes -{ - using System; - using System.IO; - using System.Collections.Generic; - using System.Text; - - public abstract class AmqpType - { - public abstract void Encode(byte[] bufer, int offset, int count); - public abstract int EncodedSize { get; } - public abstract AmqpType Clone(); - } -} diff --git a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpTypes.csproj b/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpTypes.csproj deleted file mode 100644 index 2a544cf6d0..0000000000 --- a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpTypes.csproj +++ /dev/null @@ -1,158 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{820BFC34-A40F-46BA-B86B-05334854CA17}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.AmqpTypes</RootNamespace>
- <AssemblyName>Apache.Qpid.AmqpTypes</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
- <SignAssembly>true</SignAssembly>
- <AssemblyOriginatorKeyFile>..\..\..\wcfnet.snk</AssemblyOriginatorKeyFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </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="AmqpBoolean.cs" />
- <Compile Include="AmqpInt.cs" />
- <Compile Include="AmqpProperties.cs" />
- <Compile Include="AmqpString.cs" />
- <Compile Include="AmqpType.cs" />
- <Compile Include="AmqpUbyte.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="PropertyName.cs" />
- </ItemGroup>
- <ItemGroup>
- <None Include="..\..\..\wcfnet.snk" />
- </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">
-<Message Text="yet another debug line" />
- </Target>
- <Target Name="AfterBuild"
- >
-<Message Text="a debug line before banana.netmodule" />
- <PropertyGroup Condition="('$(TargetFrameworkVersion)' != 'v1.0') and ('$(TargetFrameworkVersion)' != 'v1.1')">
- <NoWarn>$(NoWarn);1701;1702</NoWarn>
- </PropertyGroup>
-
- <Csc
- AdditionalLibPaths="$(AdditionalLibPaths)"
- AddModules="@(AddModules)"
- AllowUnsafeBlocks="$(AllowUnsafeBlocks)"
- BaseAddress="$(BaseAddress)"
- CheckForOverflowUnderflow="$(CheckForOverflowUnderflow)"
- CodePage="$(CodePage)"
- DebugType="$(DebugType)"
- DefineConstants="$(DefineConstants)"
- DelaySign="$(DelaySign)"
- DisabledWarnings="$(NoWarn)"
- DocumentationFile="@(DocFileItem)"
- EmitDebugInformation="$(DebugSymbols)"
- ErrorReport="$(ErrorReport)"
- FileAlignment="$(FileAlignment)"
- GenerateFullPaths="$(GenerateFullPaths)"
- KeyContainer="$(KeyContainerName)"
- KeyFile="$(KeyOriginatorFile)"
- LangVersion="$(LangVersion)"
- MainEntryPoint="$(StartupObject)"
- ModuleAssemblyName="banana"
- NoConfig="true"
- NoLogo="$(NoLogo)"
- NoStandardLib="$(NoStdLib)"
- NoWin32Manifest="$(NoWin32Manifest)"
- Optimize="$(Optimize)"
- OutputAssembly="@(IntermediateAssembly)"
- PdbFile="$(PdbFile)"
- Platform="$(PlatformTarget)"
- References="@(ReferencePath)"
- Resources="@(_CoreCompileResourceInputs);@(CompiledLicenseFile)"
- ResponseFiles="$(CompilerResponseFile)"
- Sources="@(Compile)"
- TargetType="module"
- ToolExe="$(CscToolExe)"
- ToolPath="$(CscToolPath)"
- TreatWarningsAsErrors="$(TreatWarningsAsErrors)"
- UseHostCompilerIfAvailable="$(UseHostCompilerIfAvailable)"
- Utf8Output="$(Utf8Output)"
- WarningLevel="$(WarningLevel)"
- WarningsAsErrors="$(WarningsAsErrors)"
- WarningsNotAsErrors="$(WarningsNotAsErrors)"
- Win32Icon="$(ApplicationIcon)"
- Win32Manifest="$(Win32Manifest)"
- Win32Resource="$(Win32Resource)"
- />
-
- <ItemGroup>
- <_CoreCompileResourceInputs Remove="@(_CoreCompileResourceInputs)" />
- </ItemGroup>
-
-<Message Text="a debug line after banana.netmodule" />
- </Target>
- -->
- <PropertyGroup>
- <PostBuildEvent>cd "$(ProjectDir)bin\$(ConfigurationName)"
-del $(AssemblyName).dll
-del $(AssemblyName).pdb
-cd "$(ProjectDir)obj\$(ConfigurationName)"
-del $(AssemblyName).dll
-del $(AssemblyName).pdb
-cd "$(ProjectDir)"
-CreateNetModule.bat $(ConfigurationName)</PostBuildEvent>
- </PropertyGroup>
-</Project>
\ No newline at end of file diff --git a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpUbyte.cs b/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpUbyte.cs deleted file mode 100644 index 5ec8a732cf..0000000000 --- a/qpid/wcf/src/Apache/Qpid/AmqpTypes/AmqpUbyte.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.AmqpTypes -{ - using System; - using System.IO; - using System.Collections.Generic; - using System.Text; - - public class AmqpUbyte : AmqpType - { - byte value; - - public AmqpUbyte(byte i) - { - this.value = i; - } - - public override void Encode(byte[] bufer, int offset, int count) - { - throw new NotImplementedException(); - } - - public override int EncodedSize - { - get { throw new NotImplementedException(); } - } - - public override AmqpType Clone() - { - return new AmqpUbyte(this.value); - } - - public byte Value - { - get { return this.value; } - set { this.value = value; } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/AmqpTypes/CreateNetModule.bat b/qpid/wcf/src/Apache/Qpid/AmqpTypes/CreateNetModule.bat deleted file mode 100755 index d67e2119f9..0000000000 --- a/qpid/wcf/src/Apache/Qpid/AmqpTypes/CreateNetModule.bat +++ /dev/null @@ -1,33 +0,0 @@ - -REM Licensed to the Apache Software Foundation (ASF) under one -REM or more contributor license agreements. See the NOTICE file -REM distributed with this work for additional information -REM regarding copyright ownership. The ASF licenses this file -REM to you under the Apache License, Version 2.0 (the -REM "License"); you may not use this file except in compliance -REM with the License. You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, -REM software distributed under the License is distributed on an -REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -REM KIND, either express or implied. See the License for the -REM specific language governing permissions and limitations -REM under the License. - -if %1 == Release goto release - -echo generating Debug netmodule - -%systemroot%\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:%systemroot%\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:%systemroot%\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:%systemroot%\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug+ /debug:full /filealign:512 /optimize- /out:obj\Debug\Apache.Qpid.AmqpTypes.netmodule /target:module *.cs - -goto end - -:release - -echo generating Release netmodule - -%systemroot%\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:TRACE /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Data.DataSetExtensions.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /reference:"%programfiles%\Reference Assemblies\Microsoft\Framework\v3.5\System.Xml.Linq.dll" /debug:pdbonly /filealign:512 /keyfile:..\..\..\wcfnet.snk /optimize+ /out:obj\Release\Apache.Qpid.AmqpTypes.netmodule /target:module *.cs - -:end
\ No newline at end of file diff --git a/qpid/wcf/src/Apache/Qpid/AmqpTypes/Properties/AssemblyInfo.cs b/qpid/wcf/src/Apache/Qpid/AmqpTypes/Properties/AssemblyInfo.cs deleted file mode 100644 index dffaee0d0d..0000000000 --- a/qpid/wcf/src/Apache/Qpid/AmqpTypes/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* -* 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.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("Apache.Qpid.AmqpTypes")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to true makes the types in this assembly visible -// to COM components. This is required for this to be used by an -// Excel RTD component. -[assembly: ComVisible(true)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("79b8b5d9-047d-4f3b-8610-7fe112ce6416")] - -// 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")] diff --git a/qpid/wcf/src/Apache/Qpid/AmqpTypes/PropertyName.cs b/qpid/wcf/src/Apache/Qpid/AmqpTypes/PropertyName.cs deleted file mode 100644 index b80f8b9e9e..0000000000 --- a/qpid/wcf/src/Apache/Qpid/AmqpTypes/PropertyName.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.AmqpTypes -{ - using System; - using System.IO; - using System.Collections.Generic; - using System.Text; - - public sealed class PropertyName - { - public const string Priority = "amqpx.priority"; - public const string ContentType = "amqp.content-type"; - public const string ReplyTo = "amqp.reply-to"; - public const string ReplyToExchange = "amqpx.qpid0-10.reply-to-exchange"; - public const string RoutingKey = "amqpx.qpid0-10.routing-key"; - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinaryBinding.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinaryBinding.cs deleted file mode 100644 index d533fc212e..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinaryBinding.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Configuration; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Configuration; - - using Apache.Qpid.AmqpTypes; - - public class AmqpBinaryBinding : AmqpBinding - { - public AmqpBinaryBinding() -: base (new RawMessageEncodingBindingElement()) - { - } - - public AmqpBinaryBinding(string configurationName) - : this() - { - ApplyConfiguration(configurationName); - } - - private void ApplyConfiguration(string configurationName) - { - BindingsSection wcfBindings = (BindingsSection)ConfigurationManager.GetSection("system.serviceModel/bindings"); - // wcfBindings contains system defined bindings and bindingExtensions - - AmqpBinaryBindingCollectionElement section = (AmqpBinaryBindingCollectionElement)wcfBindings["amqpBinaryBinding"]; - if (section == null) - { - throw new ConfigurationErrorsException("Missing \"amqpBinaryBinding\" configuration section."); - } - - AmqpBinaryBindingConfigurationElement element = section.Bindings[configurationName]; - if (element == null) - { - throw new ConfigurationErrorsException(string.Format(System.Globalization.CultureInfo.CurrentCulture, - "There is no binding named {0} at {1}.", configurationName, section.BindingName)); - } - else - { - element.ApplyConfiguration(this); - } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinaryBindingCollectionElement.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinaryBindingCollectionElement.cs deleted file mode 100644 index de263bc4ef..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinaryBindingCollectionElement.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - /// <summary> - /// Implement application configuration of bindingExtensions for AmqpBinaryBinding - /// </summary> - public class AmqpBinaryBindingCollectionElement - : System.ServiceModel.Configuration.StandardBindingCollectionElement<AmqpBinaryBinding, AmqpBinaryBindingConfigurationElement> - { - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinaryBindingConfigurationElement.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinaryBindingConfigurationElement.cs deleted file mode 100644 index a537a6c6c3..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinaryBindingConfigurationElement.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Configuration; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Configuration; - using Apache.Qpid.AmqpTypes; - - public class AmqpBinaryBindingConfigurationElement : AmqpBindingConfigurationElement - { - public AmqpBinaryBindingConfigurationElement(string configurationName) - : base(configurationName) - { - } - - public AmqpBinaryBindingConfigurationElement() - : this(null) - { - } - - protected override Type BindingElementType - { - get { return typeof(AmqpBinaryBinding); } - } - - protected override ConfigurationPropertyCollection Properties - { - get - { - ConfigurationPropertyCollection properties = base.Properties; - - return properties; - } - } - - protected override void InitializeFrom(Binding binding) - { - base.InitializeFrom(binding); - AmqpBinaryBinding amqpBinding = (AmqpBinaryBinding)binding; - } - - protected override void OnApplyConfiguration(Binding binding) - { - if (binding == null) - throw new ArgumentNullException("binding"); - - if (binding.GetType() != typeof(AmqpBinaryBinding)) - { - throw new ArgumentException(string.Format("Invalid type for configuring an AMQP binding. Expected type: {0}. Type passed in: {1}.", - typeof(AmqpBinaryBinding).AssemblyQualifiedName, - binding.GetType().AssemblyQualifiedName)); - } - - base.OnApplyConfiguration(binding); - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinding.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinding.cs deleted file mode 100644 index be54f06b2f..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBinding.cs +++ /dev/null @@ -1,153 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Configuration; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Configuration; - - using Apache.Qpid.AmqpTypes; - - public class AmqpBinding : Binding - { - protected AmqpTransportBindingElement transport; - protected MessageEncodingBindingElement encoding; - protected AmqpSecurity security; - - public AmqpBinding() - : this(new BinaryMessageEncodingBindingElement()) - { - } - - protected AmqpBinding(MessageEncodingBindingElement encoding) - { - this.encoding = encoding; - transport = new AmqpTransportBindingElement(); - } - - public AmqpBinding(string configurationName) - : this() - { - ApplyConfiguration(configurationName); - } - - public string BrokerHost - { - get { return transport.BrokerHost; } - set { transport.BrokerHost = value; } - } - - public int BrokerPort - { - get { return transport.BrokerPort; } - set { transport.BrokerPort = value; } - } - - public int PrefetchLimit - { - get { return transport.PrefetchLimit; } - set { transport.PrefetchLimit = value; } - } - - public AmqpSecurity Security - { - get - { - if (security == null) - { - if (transport.ChannelProperties.AmqpTransportSecurity == null) - { - transport.ChannelProperties.AmqpTransportSecurity = new AmqpTransportSecurity(); - } - - security = new AmqpSecurity(transport.ChannelProperties.AmqpTransportSecurity); - transport.BindingSecurity = security; - } - - return security; - } - } - - internal bool SecurityEnabled - { - get { return (transport.ChannelProperties.AmqpSecurityMode != AmqpSecurityMode.None); } - } - - public bool Shared - { - get { return transport.Shared; } - set { transport.Shared = value; } - } - - public TransferMode TransferMode - { - get { return transport.TransferMode; } - set { transport.TransferMode = value; } - } - - public AmqpProperties DefaultMessageProperties - { - get { return transport.DefaultMessageProperties; } - set { transport.DefaultMessageProperties = value; } - } - - public override string Scheme - { - get { return AmqpConstants.Scheme; } - } - - public override BindingElementCollection CreateBindingElements() - { - BindingElementCollection bindingElements = new BindingElementCollection(); - - bindingElements.Add(encoding); - bindingElements.Add(transport); - - return bindingElements.Clone(); - } - - private void ApplyConfiguration(string configurationName) - { - BindingsSection wcfBindings = (BindingsSection)ConfigurationManager.GetSection("system.serviceModel/bindings"); - // wcfBindings contains system defined bindings and bindingExtensions - - AmqpBindingCollectionElement section = (AmqpBindingCollectionElement)wcfBindings["amqpBinding"]; - if (section == null) - { - throw new ConfigurationErrorsException("Missing \"amqpBinding\" configuration section."); - } - - AmqpBindingConfigurationElement element = section.Bindings[configurationName]; - if (element == null) - { - throw new ConfigurationErrorsException(string.Format(System.Globalization.CultureInfo.CurrentCulture, - "There is no binding named {0} at {1}.", configurationName, section.BindingName)); - } - else - { - element.ApplyConfiguration(this); - } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBindingCollectionElement.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpBindingCollectionElement.cs deleted file mode 100644 index e8d3b6fad4..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBindingCollectionElement.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - /// <summary> - /// Implement application configuration of bindingExtensions for AmqpBinding - /// </summary> - public class AmqpBindingCollectionElement - : System.ServiceModel.Configuration.StandardBindingCollectionElement<AmqpBinding, AmqpBindingConfigurationElement> - { - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBindingConfigurationElement.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpBindingConfigurationElement.cs deleted file mode 100644 index edc91e67c1..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpBindingConfigurationElement.cs +++ /dev/null @@ -1,344 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.Collections.Generic; - using System.Collections.ObjectModel; - using System.Configuration; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Configuration; - using System.Threading; - using Apache.Qpid.AmqpTypes; - - public class AmqpBindingConfigurationElement : StandardBindingElement - { - // not regular config elements. See PostDeserialize - string brokerHost; - int brokerPort; - - public AmqpBindingConfigurationElement(string configurationName) - : base(configurationName) - { - brokerHost = AmqpDefaults.BrokerHost; - brokerPort = AmqpDefaults.BrokerPort; - } - - public AmqpBindingConfigurationElement() - : this(null) - { - } - - protected override Type BindingElementType - { - get { return typeof(AmqpBinding); } - } - - public string BrokerHost - { - get { return brokerHost; } - set { brokerHost = value; } - } - - public int BrokerPort - { - get { return brokerPort; } - set { brokerPort = value; } - } - - [ConfigurationProperty(AmqpConfigurationStrings.PrefetchLimit, DefaultValue = false)] - public int PrefetchLimit - { - get { return (int)base[AmqpConfigurationStrings.PrefetchLimit]; } - set { base[AmqpConfigurationStrings.PrefetchLimit] = value; } - } - - [ConfigurationProperty(AmqpConfigurationStrings.Shared, DefaultValue = false)] - public bool Shared - { - get { return (bool)base[AmqpConfigurationStrings.Shared]; } - set { base[AmqpConfigurationStrings.Shared] = value; } - } - - [ConfigurationProperty(AmqpConfigurationStrings.TransferMode, DefaultValue = AmqpDefaults.TransferMode)] - public TransferMode TransferMode - { - get { return (TransferMode)base[AmqpConfigurationStrings.TransferMode]; } - set { base[AmqpConfigurationStrings.TransferMode] = value; } - } - - [ConfigurationProperty(AmqpConfigurationStrings.Brokers)] - public BrokerCollection Brokers - { - get - { - return (BrokerCollection)base[AmqpConfigurationStrings.Brokers]; - } - set - { - base[AmqpConfigurationStrings.Brokers] = value; - } - } - - [ConfigurationProperty(AmqpConfigurationStrings.Security)] - public AmqpSecurityElement Security - { - get { return (AmqpSecurityElement)base[AmqpConfigurationStrings.Security]; } - set { base[AmqpConfigurationStrings.Security] = value; } - } - - protected override ConfigurationPropertyCollection Properties - { - get - { - ConfigurationPropertyCollection properties = base.Properties; - properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.PrefetchLimit, - typeof(int), 0, null, null, ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.Shared, - typeof(bool), false, null, null, ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.TransferMode, - typeof(TransferMode), AmqpDefaults.TransferMode, null, null, ConfigurationPropertyOptions.None)); - properties.Add(new ConfigurationProperty("brokers", typeof(BrokerCollection), null)); - properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.Security, typeof(AmqpSecurityElement), null)); - return properties; - } - } - - protected override void InitializeFrom(Binding binding) - { - base.InitializeFrom(binding); - AmqpBinding amqpBinding = (AmqpBinding)binding; - this.BrokerHost = amqpBinding.BrokerHost; - this.BrokerPort = amqpBinding.BrokerPort; - this.TransferMode = amqpBinding.TransferMode; - this.Shared = amqpBinding.Shared; - this.PrefetchLimit = amqpBinding.PrefetchLimit; - - if (!amqpBinding.SecurityEnabled) - { - this.Security = null; - } - else - { - if (this.Security == null) - { - this.Security = new AmqpSecurityElement(); - } - - AmqpTransportSecurity sec = amqpBinding.Security.Transport; - this.Security.Mode = AmqpSecurityMode.Transport; - if (this.Security.Transport == null) - { - this.Security.Transport = new AmqpTransportSecurityElement(); - } - - this.Security.Transport.CredentialType = sec.CredentialType; - this.Security.Transport.IgnoreEndpointCredentials = sec.IgnoreEndpointClientCredentials; - this.Security.Transport.UseSSL = sec.UseSSL; - if (sec.DefaultCredential == null) - { - - this.Security.Transport.DefaultCredential = null; - } - else - { - this.Security.Transport.DefaultCredential = new AmqpCredentialElement(); - this.Security.Transport.DefaultCredential.UserName = sec.DefaultCredential.UserName; - this.Security.Transport.DefaultCredential.Password = sec.DefaultCredential.Password; - } - } - - AmqpProperties props = amqpBinding.DefaultMessageProperties; - } - - protected override void OnApplyConfiguration(Binding binding) - { - if (binding == null) - throw new ArgumentNullException("binding"); - - if (!(binding is AmqpBinding)) - { - throw new ArgumentException(string.Format("Invalid type for configuring an AMQP binding. Expected type: {0}. Type passed in: {1}.", - typeof(AmqpBinding).AssemblyQualifiedName, - binding.GetType().AssemblyQualifiedName)); - } - - AmqpBinding amqpBinding = (AmqpBinding)binding; - amqpBinding.BrokerHost = this.BrokerHost; - amqpBinding.BrokerPort = this.BrokerPort; - amqpBinding.TransferMode = this.TransferMode; - amqpBinding.Shared = this.Shared; - amqpBinding.PrefetchLimit = this.PrefetchLimit; - - AmqpSecurityMode mode = AmqpSecurityMode.None; - if (this.Security != null) - { - mode = this.Security.Mode; - } - - if (mode == AmqpSecurityMode.None) - { - if (amqpBinding.SecurityEnabled) - { - amqpBinding.Security.Mode = AmqpSecurityMode.None; - } - } - else - { - amqpBinding.Security.Mode = AmqpSecurityMode.Transport; - amqpBinding.Security.Transport.CredentialType = this.Security.Transport.CredentialType; - amqpBinding.Security.Transport.IgnoreEndpointClientCredentials = this.Security.Transport.IgnoreEndpointCredentials; - amqpBinding.Security.Transport.UseSSL = this.Security.Transport.UseSSL; - if (this.Security.Transport.DefaultCredential != null) - { - amqpBinding.Security.Transport.DefaultCredential = new AmqpCredential( - this.Security.Transport.DefaultCredential.UserName, - this.Security.Transport.DefaultCredential.Password); - } - else - { - amqpBinding.Security.Transport.DefaultCredential = null; - } - } - } - - - protected override void PostDeserialize() - { - base.PostDeserialize(); - - BrokerCollection brokers = Brokers; - if (brokers != null) - { - if (brokers.Count > 0) - { - // just grab the first element until failover is supported - System.Collections.IEnumerator brokersEnum = brokers.GetEnumerator(); - // move to first element - brokersEnum.MoveNext(); - BrokerElement be = (BrokerElement)brokersEnum.Current; - this.BrokerHost = be.Host; - this.BrokerPort = be.Port; - } - } - } - } - - public class BrokerCollection : ConfigurationElementCollection - { - public BrokerCollection() - { - //this.AddElementName = "broker"; - } - - protected override ConfigurationElement CreateNewElement() - { - return new BrokerElement(); - } - - protected override void BaseAdd(ConfigurationElement element) - { - BrokerElement be = (BrokerElement)element; - if (this.BaseGet((Object)be.Key) != null) - { - throw new ConfigurationErrorsException("duplicate broker definition at line " + element.ElementInformation.LineNumber); - } - base.BaseAdd(element); - } - - protected override Object GetElementKey(ConfigurationElement element) - { - BrokerElement be = (BrokerElement) element; - return be.Key; - } - - protected override void PostDeserialize() - { - base.PostDeserialize(); - if (this.Count == 0) - { - throw new ArgumentException("Brokers collection requires at least one broker"); - } - if (this.Count > 1) - { - Console.WriteLine("Warning: multiple brokers not supported, selecting first instance"); - } - BrokerElement be = (BrokerElement)this.BaseGet(0); - } - - protected override string ElementName - { - get - { - return "broker"; - } - } - - public override ConfigurationElementCollectionType CollectionType - { - get - { - return ConfigurationElementCollectionType.BasicMap; - } - } - } - - public class BrokerElement : ConfigurationElement - { - string key; - - public BrokerElement() - { - Properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.BrokerHost, - typeof(string), AmqpDefaults.BrokerHost, null, null, ConfigurationPropertyOptions.None)); - Properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.BrokerPort, - typeof(int), AmqpDefaults.BrokerPort, null, null, ConfigurationPropertyOptions.None)); - - } - - [ConfigurationProperty(AmqpConfigurationStrings.BrokerHost, DefaultValue = AmqpDefaults.BrokerHost)] - public string Host - { - get { return (string)base[AmqpConfigurationStrings.BrokerHost]; } - set { base[AmqpConfigurationStrings.BrokerHost] = value; } - } - - [ConfigurationProperty(AmqpConfigurationStrings.BrokerPort, DefaultValue = AmqpDefaults.BrokerPort)] - public int Port - { - get { return (int)base[AmqpConfigurationStrings.BrokerPort]; } - set { base[AmqpConfigurationStrings.BrokerPort] = value; } - } - - public string Key - { - get - { - if (this.key == null) - { - this.key = this.Host + ':' + this.Port; - } - return this.key; - } - } - - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelFactory.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelFactory.cs deleted file mode 100644 index 9b27b00994..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelFactory.cs +++ /dev/null @@ -1,154 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Description; - using System.Collections.Generic; - using System.Collections.ObjectModel; - - class AmqpChannelFactory<TChannel> : ChannelFactoryBase<TChannel> - { - MessageEncoderFactory messageEncoderFactory; - AmqpTransportBindingElement bindingElement; - AmqpChannelProperties channelProperties; - long maxBufferPoolSize; - bool shared; - int prefetchLimit; - BindingContext bindingContext; - List<AmqpTransportChannel> openChannels; - - internal AmqpChannelFactory(AmqpTransportBindingElement bindingElement, BindingContext context) - : base(context.Binding) - { - this.bindingElement = bindingElement; - this.bindingContext = context; - this.channelProperties = bindingElement.ChannelProperties.Clone(); - this.shared = bindingElement.Shared; - this.prefetchLimit = bindingElement.PrefetchLimit; - this.maxBufferPoolSize = bindingElement.MaxBufferPoolSize; - Collection<MessageEncodingBindingElement> messageEncoderBindingElements - = context.BindingParameters.FindAll<MessageEncodingBindingElement>(); - - if (messageEncoderBindingElements.Count > 1) - { - throw new InvalidOperationException("More than one MessageEncodingBindingElement was found in the BindingParameters of the BindingContext"); - } - else if (messageEncoderBindingElements.Count == 1) - { - this.messageEncoderFactory = messageEncoderBindingElements[0].CreateMessageEncoderFactory(); - } - else - { - this.messageEncoderFactory = new TextMessageEncodingBindingElement().CreateMessageEncoderFactory(); - } - - openChannels = new List<AmqpTransportChannel>(); - } - - - public override T GetProperty<T>() - { - T mep = messageEncoderFactory.Encoder.GetProperty<T>(); - if (mep != null) - { - return mep; - } - - if (typeof(T) == typeof(MessageVersion)) - { - return (T)(object)messageEncoderFactory.Encoder.MessageVersion; - } - - return base.GetProperty<T>(); - } - - protected override void OnOpen(TimeSpan timeout) - { - // check and freeze security properties now - AmqpSecurityMode mode = AmqpSecurityMode.None; - if (this.bindingElement.BindingSecurity != null) - { - mode = bindingElement.BindingSecurity.Mode; - } - - this.channelProperties.AmqpSecurityMode = mode; - if (mode == AmqpSecurityMode.None) - { - return; - } - - AmqpChannelHelpers.FindAuthenticationCredentials(this.channelProperties, this.bindingContext); - } - - protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) - { - throw new NotImplementedException("AmqpChannelFactory OnBeginOpen"); - //// return null; - } - - protected override void OnEndOpen(IAsyncResult result) - { - throw new NotImplementedException("AmqpChannelFactory OnEndOpen"); - } - - protected override TChannel OnCreateChannel(EndpointAddress remoteAddress, Uri via) - { - AmqpTransportChannel channel = new AmqpTransportChannel(this, this.channelProperties, remoteAddress, this.messageEncoderFactory.Encoder, this.maxBufferPoolSize, this.shared, this.prefetchLimit); - lock (openChannels) - { - channel.Closed += new EventHandler(channel_Closed); - openChannels.Add(channel); - } - return (TChannel)(object) channel; - } - - void channel_Closed(object sender, EventArgs e) - { - if (this.State != CommunicationState.Opened) - { - return; - } - - lock (openChannels) - { - AmqpTransportChannel channel = (AmqpTransportChannel)sender; - if (openChannels.Contains(channel)) - { - openChannels.Remove(channel); - } - } - } - - protected override void OnClose(TimeSpan timeout) - { - base.OnClose(timeout); - lock (openChannels) - { - foreach (AmqpTransportChannel channel in openChannels) - { - channel.Close(timeout); - } - } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelHelpers.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelHelpers.cs deleted file mode 100644 index b431689c4d..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelHelpers.cs +++ /dev/null @@ -1,234 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.Net; - using System.Net.Sockets; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Description; - using System.Globalization; - - using Apache.Qpid.AmqpTypes; - - /// <summary> - /// Collection of constants used by the Amqp Channel classes - /// </summary> - static class AmqpConstants - { - internal const string Scheme = "amqp"; - internal const string AmqpBindingSectionName = "system.serviceModel/bindings/amqpBinding"; - internal const string AmqpBinaryBindingSectionName = "system.serviceModel/bindings/amqpBinaryBinding"; - internal const string AmqpTransportSectionName = "amqpTransport"; - } - - static class AmqpConfigurationStrings - { - public const string BrokerHost = "host"; - public const string BrokerPort = "port"; - public const string TransferMode = "transferMode"; - public const string Brokers = "brokers"; - public const string Shared = "shared"; - public const string PrefetchLimit = "prefetchLimit"; - public const string MaxBufferPoolSize = "maxBufferPoolSize"; - public const string MaxReceivedMessageSize = "maxReceivedMessageSize"; - public const string Security = "security"; - public const string SecurityMode = "mode"; - public const string SecurityTransport = "transport"; - public const string SecurityTransportCredentialType = "credentialType"; - public const string SecurityTransportUseSSL = "useSSL"; - public const string SecurityTransportDefaultCredential = "defaultCredential"; - public const string SecurityTransportIgnoreEndpointCredentials = "ignoreEndpointCredentials"; - public const string CredentialUserName = "userName"; - public const string CredentialPassword = "password"; - } - - static class AmqpDefaults - { - internal const string BrokerHost = "localhost"; - internal const int BrokerPort = 5672; - internal const TransferMode TransferMode = System.ServiceModel.TransferMode.Buffered; - internal const long MaxBufferPoolSize = 64 * 1024; - internal const int MaxReceivedMessageSize = 5 * 1024 * 1024; //64 * 1024; - } - - // parking spot for properties that may be shared by separate channels on a single AMQP connection - internal class AmqpChannelProperties - { - string brokerHost; - int brokerPort; - TransferMode transferMode; - AmqpProperties defaultMessageProperties; - AmqpSecurityMode amqpSecurityMode; - AmqpTransportSecurity amqpTransportSecurity; - AmqpCredential amqpCredential; - long maxBufferPoolSize; - int maxReceivedMessageSize; - - internal AmqpChannelProperties() - { - this.brokerHost = AmqpDefaults.BrokerHost; - this.brokerPort = AmqpDefaults.BrokerPort; - this.transferMode = AmqpDefaults.TransferMode; - this.defaultMessageProperties = null; - this.amqpSecurityMode = AmqpSecurityMode.None; - this.amqpTransportSecurity = null; - this.amqpCredential = null; - this.maxBufferPoolSize = AmqpDefaults.MaxBufferPoolSize; - this.maxReceivedMessageSize = AmqpDefaults.MaxReceivedMessageSize; - } - - public AmqpChannelProperties Clone() - { - AmqpChannelProperties props = (AmqpChannelProperties) this.MemberwiseClone(); - if (this.defaultMessageProperties != null) - { - props.defaultMessageProperties = this.defaultMessageProperties.Clone(); - } - - if (this.amqpTransportSecurity != null) - { - props.amqpTransportSecurity = this.amqpTransportSecurity.Clone(); - } - - if (this.amqpCredential != null) - { - this.amqpCredential = this.amqpCredential.Clone(); - } - - return props; - } - - internal string BrokerHost - { - get { return this.brokerHost; } - set { this.brokerHost = value; } - } - - internal int BrokerPort - { - get { return this.brokerPort; } - set { this.brokerPort = value; } - } - - internal TransferMode TransferMode - { - get { return this.transferMode; } - set { this.transferMode = value; } - } - - internal AmqpProperties DefaultMessageProperties - { - get { return this.defaultMessageProperties; } - set { this.defaultMessageProperties = value; } - } - - internal AmqpSecurityMode AmqpSecurityMode - { - get { return this.amqpSecurityMode; } - set { this.amqpSecurityMode = value; } - } - - internal AmqpTransportSecurity AmqpTransportSecurity - { - get { return this.amqpTransportSecurity; } - set { this.amqpTransportSecurity = value; } - } - - internal AmqpCredential AmqpCredential - { - get { return this.amqpCredential; } - set { this.amqpCredential = value; } - } - - internal long MaxBufferPoolSize - { - get { return this.maxBufferPoolSize; } - set { this.maxBufferPoolSize = value; } - } - - internal int MaxReceivedMessageSize - { - get { return this.maxReceivedMessageSize; } - set { this.maxReceivedMessageSize = value; } - } - } - - static class AmqpChannelHelpers - { - internal static void ValidateTimeout(TimeSpan timeout) - { - if (timeout < TimeSpan.Zero) - { - throw new ArgumentOutOfRangeException("timeout", timeout, "Timeout must be greater than or equal to TimeSpan.Zero. To disable timeout, specify TimeSpan.MaxValue."); - } - } - - internal static void FindAuthenticationCredentials(AmqpChannelProperties channelProperties, - BindingContext bindingContext) - { - AmqpTransportSecurity tsec = channelProperties.AmqpTransportSecurity; - if (tsec == null) - { - // no auth - return; - } - - if (tsec.CredentialType == AmqpCredentialType.Anonymous) - { - // no auth - return; - } - - // credentials search order: specific AmqpCredentials, specific - // ClientCredentials (if applicable), binding's default credentials - - AmqpCredential amqpCred = bindingContext.BindingParameters.Find<AmqpCredential>(); - if (amqpCred != null) - { - channelProperties.AmqpCredential = amqpCred.Clone(); - return; - } - - if (!tsec.IgnoreEndpointClientCredentials) - { - ClientCredentials cliCred = bindingContext.BindingParameters.Find<ClientCredentials>(); - if (cliCred != null) - { - if (cliCred.UserName != null) - { - if (cliCred.UserName.UserName != null) - { - channelProperties.AmqpCredential = new AmqpCredential(cliCred.UserName.UserName, - cliCred.UserName.Password); - return; - } - } - } - } - - if (tsec.DefaultCredential != null) - { - channelProperties.AmqpCredential = tsec.DefaultCredential.Clone(); - } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelListener.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelListener.cs deleted file mode 100644 index 78655f2124..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpChannelListener.cs +++ /dev/null @@ -1,204 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.Threading; - using System.Collections.Generic; - using System.Collections.ObjectModel; - - class AmqpChannelListener : ChannelListenerBase<IInputChannel> - { - MessageEncoderFactory messageEncoderFactory; - AmqpTransportBindingElement bindingElement; - AmqpChannelProperties channelProperties; - BindingContext bindingContext; - bool shared; - int prefetchLimit; - long maxBufferPoolSize; - Uri uri; - AmqpTransportChannel amqpTransportChannel; - delegate IInputChannel AsyncOnAcceptCaller (TimeSpan timeout); - AsyncOnAcceptCaller asyncOnAcceptCaller; - ManualResetEvent acceptWaitEvent; - - internal AmqpChannelListener(AmqpTransportBindingElement bindingElement, BindingContext context) - : base(context.Binding) - { - this.bindingElement = bindingElement; - this.channelProperties = bindingElement.ChannelProperties.Clone(); - this.bindingContext = context; - this.shared = bindingElement.Shared; - this.prefetchLimit = bindingElement.PrefetchLimit; - - this.maxBufferPoolSize = bindingElement.MaxBufferPoolSize; - - // TODO: review this. Should be unique hostname based - this.uri = context.ListenUriBaseAddress; - this.asyncOnAcceptCaller = new AsyncOnAcceptCaller(this.OnAcceptChannel); - this.acceptWaitEvent = new ManualResetEvent(false); - - Collection<MessageEncodingBindingElement> messageEncoderBindingElements - = context.BindingParameters.FindAll<MessageEncodingBindingElement>(); - - if(messageEncoderBindingElements.Count > 1) - { - throw new InvalidOperationException("More than one MessageEncodingBindingElement was found in the BindingParameters of the BindingContext"); - } - else if (messageEncoderBindingElements.Count == 1) - { - this.messageEncoderFactory = messageEncoderBindingElements[0].CreateMessageEncoderFactory(); - } - else - { - this.messageEncoderFactory = new TextMessageEncodingBindingElement().CreateMessageEncoderFactory(); - } - } - - public override Uri Uri - { - get - { - return this.uri; - } - } - - - - public override T GetProperty<T>() - { - T mep = messageEncoderFactory.Encoder.GetProperty<T>(); - if (mep != null) - { - return mep; - } - - if (typeof(T) == typeof(MessageVersion)) - { - return (T)(object)messageEncoderFactory.Encoder.MessageVersion; - } - - return base.GetProperty<T>(); - } - - protected override void OnOpen(TimeSpan timeout) - { - // check and freeze security properties now - AmqpSecurityMode mode = AmqpSecurityMode.None; - if (this.bindingElement.BindingSecurity != null) - { - mode = bindingElement.BindingSecurity.Mode; - } - - this.channelProperties.AmqpSecurityMode = mode; - if (mode == AmqpSecurityMode.None) - { - return; - } - - AmqpChannelHelpers.FindAuthenticationCredentials(this.channelProperties, this.bindingContext); - } - - protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) - { - throw new NotImplementedException("AmqpChannelListener OnBeginOpen"); - //// return null; - } - - protected override void OnEndOpen(IAsyncResult result) - { - throw new NotImplementedException("AmqpChannelListener OnEndOpen"); - } - - protected override bool OnWaitForChannel(TimeSpan timeout) - { - throw new NotImplementedException("AmqpChannelListener OnWaitForChannel"); - } - - protected override IAsyncResult OnBeginWaitForChannel(TimeSpan timeout, AsyncCallback callback, object state) - { - throw new NotImplementedException("AmqpChannelListener OnBeginWaitForChannel"); - } - - protected override bool OnEndWaitForChannel(IAsyncResult result) - { - throw new NotImplementedException("AmqpChannelListener OnEndWaitForChannel"); - } - - protected override IInputChannel OnAcceptChannel(TimeSpan timeout) - { - if (this.IsDisposed) - { - return null; - } - - if (amqpTransportChannel == null) - { - // TODO: add timeout processing - amqpTransportChannel = new AmqpTransportChannel(this, this.channelProperties, - new EndpointAddress(uri), messageEncoderFactory.Encoder, - maxBufferPoolSize, this.shared, this.prefetchLimit); - return (IInputChannel)(object)amqpTransportChannel; - } - - // Singleton channel. Subsequent Accepts wait until the listener is closed - acceptWaitEvent.WaitOne(); - return null; - } - - protected override IAsyncResult OnBeginAcceptChannel(TimeSpan timeout, AsyncCallback callback, object state) - { - return asyncOnAcceptCaller.BeginInvoke(timeout, callback, state); - } - - protected override IInputChannel OnEndAcceptChannel(IAsyncResult result) - { - return asyncOnAcceptCaller.EndInvoke(result); - } - - protected override void OnClose(TimeSpan timeout) - { - if (amqpTransportChannel != null) - { - amqpTransportChannel.Close(); - } - acceptWaitEvent.Set(); - } - - protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) - { - throw new NotImplementedException("AmqpChannelListener OnBeginClose"); - } - - protected override void OnEndClose(IAsyncResult result) - { - throw new NotImplementedException("AmqpChannelListener OnEndClose"); - } - - protected override void OnAbort() - { - if (amqpTransportChannel != null) - amqpTransportChannel.Abort(); - acceptWaitEvent.Set(); - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpCredential.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpCredential.cs deleted file mode 100644 index e2da07c800..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpCredential.cs +++ /dev/null @@ -1,113 +0,0 @@ -/*
-* 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.
-*/
-
-/*
- * AMQP has a SASL authentication mechanism that doesn't match
- * with existing .NET credentials. The analogy breaks down further
- * if there is a list of brokers to cycle through on failover.
- * This class will allow arbitrary credentials to be specified
- * by the user, but is meant to be sensibly populated by bindings
- * that use it from ClientCredentials.
- * See the related interplay of ClientCredentials and
- * WebProxy NetworkCredential for the BasicHttpBinding.
- */
-
-namespace Apache.Qpid.Channel
-{
- using System;
-
- /// <summary>
- /// Credentials for establishing a connection to an AMQP server.
- /// </summary>
- public class AmqpCredential
- {
- private string password;
- private string userName; // SASL authentication id
- // Future: private string the_Sasl_Authorization_ID
- // Future: private X509CertificateInitiatorClientCredential tlsClientCertificate;
-
- public AmqpCredential(string userName, string password)
- {
- if (userName == null)
- {
- throw new ArgumentNullException("user name");
- }
-
- if (password == null)
- {
- throw new ArgumentNullException("password");
- }
-
- this.userName = userName;
- this.password = password;
- }
-
- public string UserName
- {
- get
- {
- if (this.userName == null)
- {
- this.userName = "";
- }
-
- return this.userName;
- }
-
- set
- {
- if (value == null)
- {
- throw new ArgumentNullException("user name");
- }
-
- this.userName = value;
- }
- }
-
- public string Password
- {
- get
- {
- if (this.password == null)
- {
- this.password = "";
- }
-
- return this.password;
- }
-
- set
- {
- if (value == null)
- {
- throw new ArgumentNullException("password");
- }
-
- this.password = value;
- }
- }
-
- public AmqpCredential Clone()
- {
- return (AmqpCredential) this.MemberwiseClone();
- }
- }
-
-}
diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpCredentialType.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpCredentialType.cs deleted file mode 100644 index 2bafbbb54e..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpCredentialType.cs +++ /dev/null @@ -1,37 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Channel
-{
- /// <summary>
- /// Enumerates the SASL authentication mechanisms used by the AMQP transport
- /// </summary>
- public enum AmqpCredentialType
- {
- /// <summary>
- /// SASL ANONYMOUS mechanism
- /// </summary>
- Anonymous,
-
- /// <summary>
- /// SASL PLAIN mechanism: username and password
- /// </summary>
- Plain
- }
-}
diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpSecurity.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpSecurity.cs deleted file mode 100644 index 5d88afb88f..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpSecurity.cs +++ /dev/null @@ -1,75 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Channel
-{
- using System;
-
- /// <summary>
- /// Specifies the types of trasport-level and message-level security used by
- /// an endpoint configured with an AmqpBinding.
- /// </summary>
- public sealed class AmqpSecurity
- {
- private AmqpSecurityMode mode;
- private AmqpTransportSecurity transportSecurity;
-
- internal AmqpSecurity()
- {
- this.mode = AmqpSecurityMode.None;
- }
-
- internal AmqpSecurity(AmqpTransportSecurity tsec)
- {
- if (tsec == null)
- {
- throw new ArgumentNullException("AmqpTransportSecurity");
- }
-
- this.mode = AmqpSecurityMode.Transport;
- this.transportSecurity = tsec;
- }
-
- /// <summary>
- /// gets or sets the security mode.
- /// </summary>
- public AmqpSecurityMode Mode
- {
- get { return this.mode; }
- set {this.mode = value; }
- }
-
- /// <summary>
- /// gets the security object that controls encryption
- /// and authentication parameters for the AMQP transport.
- /// </summary>
- public AmqpTransportSecurity Transport
- {
- get
- {
- if (this.transportSecurity == null)
- {
- this.transportSecurity = new AmqpTransportSecurity();
- }
-
- return this.transportSecurity;
- }
- }
- }
-}
diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpSecurityElement.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpSecurityElement.cs deleted file mode 100644 index f7370e40f5..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpSecurityElement.cs +++ /dev/null @@ -1,126 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Channel
-{
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Configuration;
- using System.ServiceModel;
- using System.ServiceModel.Channels;
- using System.ServiceModel.Configuration;
- using Apache.Qpid.AmqpTypes;
-
- public sealed class AmqpSecurityElement : ConfigurationElement
- {
- public AmqpSecurityElement()
- {
- Properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.SecurityMode,
- typeof(AmqpSecurityMode), AmqpSecurityMode.None, null, null, ConfigurationPropertyOptions.None));
- Properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.SecurityTransport,
- typeof(AmqpTransportSecurityElement), null));
-
- }
-
- [ConfigurationProperty(AmqpConfigurationStrings.SecurityMode, DefaultValue = AmqpSecurityMode.None)]
- public AmqpSecurityMode Mode
- {
- get { return (AmqpSecurityMode)base[AmqpConfigurationStrings.SecurityMode]; }
- set { base[AmqpConfigurationStrings.SecurityMode] = value; }
- }
-
- [ConfigurationProperty(AmqpConfigurationStrings.SecurityTransport)]
- public AmqpTransportSecurityElement Transport
- {
- get { return (AmqpTransportSecurityElement)base[AmqpConfigurationStrings.SecurityTransport]; }
- set { base[AmqpConfigurationStrings.SecurityTransport] = value; }
- }
- }
-
- public class AmqpTransportSecurityElement : ConfigurationElement
- {
- public AmqpTransportSecurityElement()
- {
- Properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.SecurityTransportCredentialType,
- typeof(AmqpCredentialType), AmqpCredentialType.Anonymous, null, null, ConfigurationPropertyOptions.None));
- Properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.SecurityTransportUseSSL,
- typeof(bool), false, null, null, ConfigurationPropertyOptions.None));
- Properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.SecurityTransportDefaultCredential,
- typeof(AmqpCredentialElement), null));
- Properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.SecurityTransportIgnoreEndpointCredentials,
- typeof(bool), false, null, null, ConfigurationPropertyOptions.None));
-
- }
-
- [ConfigurationProperty(AmqpConfigurationStrings.SecurityTransportCredentialType, DefaultValue = AmqpCredentialType.Anonymous)]
- public AmqpCredentialType CredentialType
- {
- get { return (AmqpCredentialType)base[AmqpConfigurationStrings.SecurityTransportCredentialType]; }
- set { base[AmqpConfigurationStrings.SecurityTransportCredentialType] = value; }
- }
-
- [ConfigurationProperty(AmqpConfigurationStrings.SecurityTransportUseSSL, DefaultValue = false)]
- public bool UseSSL
- {
- get { return (bool)base[AmqpConfigurationStrings.SecurityTransportUseSSL]; }
- set { base[AmqpConfigurationStrings.SecurityTransportUseSSL] = value; }
- }
-
- [ConfigurationProperty(AmqpConfigurationStrings.SecurityTransportDefaultCredential, DefaultValue = null)]
- public AmqpCredentialElement DefaultCredential
- {
- get { return (AmqpCredentialElement)base[AmqpConfigurationStrings.SecurityTransportDefaultCredential]; }
- set { base[AmqpConfigurationStrings.SecurityTransportDefaultCredential] = value; }
- }
-
- [ConfigurationProperty(AmqpConfigurationStrings.SecurityTransportIgnoreEndpointCredentials, DefaultValue = false)]
- public bool IgnoreEndpointCredentials
- {
- get { return (bool)base[AmqpConfigurationStrings.SecurityTransportIgnoreEndpointCredentials]; }
- set { base[AmqpConfigurationStrings.SecurityTransportIgnoreEndpointCredentials] = value; }
- }
- }
-
- public class AmqpCredentialElement : ConfigurationElement
- {
- public AmqpCredentialElement()
- {
- Properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.CredentialUserName,
- typeof(string), "", null, null, ConfigurationPropertyOptions.None));
- Properties.Add(new ConfigurationProperty(AmqpConfigurationStrings.CredentialPassword,
- typeof(string), "", null, null, ConfigurationPropertyOptions.None));
-
- }
-
- [ConfigurationProperty(AmqpConfigurationStrings.CredentialUserName, DefaultValue = "")]
- public string UserName
- {
- get { return (string)base[AmqpConfigurationStrings.CredentialUserName]; }
- set { base[AmqpConfigurationStrings.CredentialUserName] = value; }
- }
-
- [ConfigurationProperty(AmqpConfigurationStrings.CredentialPassword, DefaultValue = "")]
- public string Password
- {
- get { return (string)base[AmqpConfigurationStrings.CredentialPassword]; }
- set { base[AmqpConfigurationStrings.CredentialPassword] = value; }
- }
- }
-}
diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpSecurityMode.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpSecurityMode.cs deleted file mode 100644 index 88e7add054..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpSecurityMode.cs +++ /dev/null @@ -1,37 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Channel
-{
- /// <summary>
- /// Specifies whether trasport-level security is used with AMQP connections
- /// </summary>
- public enum AmqpSecurityMode
- {
- /// <summary>
- /// Indicates no security is used with the AMQP transport
- /// </summary>
- None,
-
- /// <summary>
- /// Indicates transport-level security is used with the AMQP transport
- /// </summary>
- Transport
- }
-}
diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportBindingElement.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportBindingElement.cs deleted file mode 100644 index a98f361d19..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportBindingElement.cs +++ /dev/null @@ -1,186 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.ServiceModel.Description; - using Apache.Qpid.AmqpTypes; - - public class AmqpTransportBindingElement : TransportBindingElement, ITransactedBindingElement - { - AmqpChannelProperties channelProperties; - bool shared; - int prefetchLimit; - AmqpSecurity bindingSecurity; - - public AmqpTransportBindingElement() - { - // start with default properties - channelProperties = new AmqpChannelProperties(); - } - - protected AmqpTransportBindingElement(AmqpTransportBindingElement other) - : base(other) - { - this.channelProperties = other.channelProperties.Clone(); - this.shared = other.shared; - this.prefetchLimit = other.prefetchLimit; - this.bindingSecurity = other.bindingSecurity; - } - - internal AmqpSecurity BindingSecurity - { - get { return this.bindingSecurity; } - set { this.bindingSecurity = value; } - } - - public override IChannelFactory<TChannel> BuildChannelFactory<TChannel>(BindingContext context) - { - if (context == null) - { - throw new ArgumentNullException("context"); - } - - return (IChannelFactory<TChannel>)(object)new AmqpChannelFactory<TChannel>(this, context); - } - - public override IChannelListener<TChannel> BuildChannelListener<TChannel>(BindingContext context) - { - if (context == null) - { - throw new ArgumentNullException("context"); - } - - return (IChannelListener<TChannel>)(object)new AmqpChannelListener(this, context); - } - - - - public override bool CanBuildChannelFactory<TChannel>(BindingContext context) - { - return ((typeof(TChannel) == typeof(IOutputChannel)) || - (typeof(TChannel) == typeof(IInputChannel))); - } - - public override bool CanBuildChannelListener<TChannel>(BindingContext context) - { - return ((typeof(TChannel) == typeof(IInputChannel))); - } - - public override BindingElement Clone() - { - return new AmqpTransportBindingElement(this); - } - - internal AmqpChannelProperties ChannelProperties - { - get { return channelProperties; } - } - - public AmqpCredential AmqpCredential - { - get { return this.channelProperties.AmqpCredential; } - set { this.channelProperties.AmqpCredential = value; } - } - - public string BrokerHost - { - get { return this.channelProperties.BrokerHost; } - set { this.channelProperties.BrokerHost = value; } - } - - public int BrokerPort - { - get { return this.channelProperties.BrokerPort; } - set { this.channelProperties.BrokerPort = value; } - } - - public int PrefetchLimit - { - get { return this.prefetchLimit; } - set { this.prefetchLimit = value; } - } - - public bool Shared - { - get { return this.shared; } - set { this.shared = value; } - } - - public bool TransactedReceiveEnabled - { - get { return true; } - } - - public TransferMode TransferMode - { - get { return this.channelProperties.TransferMode; } - set { this.channelProperties.TransferMode = value; } - } - - public AmqpTransportSecurity TransportSecurity - { - get - { - if (this.channelProperties.AmqpTransportSecurity == null) - { - this.channelProperties.AmqpTransportSecurity = new AmqpTransportSecurity(); - } - - return this.channelProperties.AmqpTransportSecurity; - } - } - - - public AmqpProperties DefaultMessageProperties - { - get { return this.channelProperties.DefaultMessageProperties; } - - set { this.channelProperties.DefaultMessageProperties = value; } - } - - public override T GetProperty<T>(BindingContext context) - { - if (context == null) - { - throw new ArgumentNullException("context"); - } - - if (typeof(T) == typeof(MessageVersion)) - { - return (T)(object)MessageVersion.Default; - } - - - return context.GetInnerProperty<T>(); - } - - public override string Scheme - { - get - { - return AmqpConstants.Scheme; - } - } - - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportChannel.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportChannel.cs deleted file mode 100644 index 6f0ffd9815..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportChannel.cs +++ /dev/null @@ -1,642 +0,0 @@ -/* -* 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. -*/ - -// TODO: flow control -// timeout handling -// transactions -// check if should split into separate input and output classes (little overlap) - -namespace Apache.Qpid.Channel -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.Text; - using System.Threading; - using System.Globalization; - using System.Web; - using System.Xml; - - // the thin interop layer that provides access to the Qpid AMQP client libraries - using Apache.Qpid.Interop; - using Apache.Qpid.AmqpTypes; - - /// <summary> - /// WCF client transport channel for accessing AMQP brokers using the Qpid C++ library - /// </summary> - public class AmqpTransportChannel : ChannelBase, IOutputChannel, IInputChannel - { - private static readonly EndpointAddress AnonymousAddress = - new EndpointAddress("http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous"); - - private EndpointAddress remoteAddress; - private MessageEncoder encoder; - private AmqpChannelProperties factoryChannelProperties; - private bool shared; - private int prefetchLimit; - private string encoderContentType; - // AMQP subject/routing key - private string subject; - // Qpid addressing value for "qpid.subject" property - private string qpidSubject; - - private BufferManager bufferManager; - private AmqpProperties outputMessageProperties; - - private InputLink inputLink; - private OutputLink outputLink; - - private bool isInputChannel; - private bool streamed; - - private AsyncTimeSpanCaller asyncOpenCaller; - private AsyncTimeSpanCaller asyncCloseCaller; - - internal AmqpTransportChannel(ChannelManagerBase factory, AmqpChannelProperties channelProperties, EndpointAddress remoteAddress, MessageEncoder msgEncoder, long maxBufferPoolSize, bool sharedConnection, int prefetchLimit) - : base(factory) - { - this.isInputChannel = (factory is ChannelListenerBase) || (factory is AmqpChannelFactory<IInputChannel>); - - if (remoteAddress == null) - { - throw new ArgumentException("Null Endpoint Address"); - } - - this.factoryChannelProperties = channelProperties; - this.shared = sharedConnection; - this.prefetchLimit = prefetchLimit; - this.remoteAddress = remoteAddress; - - // pull out host, port, queue, and connection arguments - string qpidAddress = this.UriToQpidAddress(remoteAddress.Uri, out subject); - - this.encoder = msgEncoder; - string ct = String.Empty; - if (this.encoder != null) - { - ct = this.encoder.ContentType; - if (ct != null) - { - int pos = ct.IndexOf(';'); - if (pos != -1) - { - ct = ct.Substring(0, pos).Trim(); - } - } - else - { - ct = "application/octet-stream"; - } - } - - this.encoderContentType = ct; - - if (this.factoryChannelProperties.TransferMode == TransferMode.Streamed) - { - this.streamed = true; - } - else - { - if (!(this.factoryChannelProperties.TransferMode == TransferMode.Buffered)) - { - throw new ArgumentException("TransferMode mode must be \"Streamed\" or \"Buffered\""); - } - - this.streamed = false; - } - - this.bufferManager = BufferManager.CreateBufferManager(maxBufferPoolSize, int.MaxValue); - - this.asyncOpenCaller = new AsyncTimeSpanCaller(this.OnOpen); - this.asyncCloseCaller = new AsyncTimeSpanCaller(this.OnClose); - - if (this.isInputChannel) - { - this.inputLink = ConnectionManager.GetInputLink(this.factoryChannelProperties, shared, false, qpidAddress); - this.inputLink.PrefetchLimit = this.prefetchLimit; - } - else - { - this.outputLink = ConnectionManager.GetOutputLink(this.factoryChannelProperties, shared, false, qpidAddress); - this.subject = this.outputLink.DefaultSubject; - this.qpidSubject = this.outputLink.QpidSubject; - } - } - - private delegate bool AsyncTryReceiveCaller(TimeSpan timeout, out Message message); - - private delegate void AsyncTimeSpanCaller(TimeSpan timeout); - - EndpointAddress IOutputChannel.RemoteAddress - { - get - { - return this.remoteAddress; - } - } - - // i.e what you would insert into a ReplyTo header to reach - // here. Presumably should be exchange/link and routing info, - // rather than the actual input queue name. - EndpointAddress IInputChannel.LocalAddress - { - get - { - // TODO: something better - return AnonymousAddress; - } - } - - AmqpProperties OutputMessageProperties - { - get - { - if (this.outputMessageProperties == null) - { - this.outputMessageProperties = this.factoryChannelProperties.DefaultMessageProperties; - if (this.outputMessageProperties == null) - { - this.outputMessageProperties = new AmqpProperties(); - } - } - - return this.outputMessageProperties; - } - } - - Uri IOutputChannel.Via - { - get - { - return this.remoteAddress.Uri; - } - } - - public override T GetProperty<T>() - { - if (typeof(T) == typeof(IInputChannel)) - { - if (this.isInputChannel) - { - return (T)(object)this; - } - } - else if (typeof(T) == typeof(IOutputChannel)) - { - if (!this.isInputChannel) - { - return (T)(object)this; - } - } - - return base.GetProperty<T>(); - } - - public void Send(Message message, TimeSpan timeout) - { - this.ThrowIfDisposedOrNotOpen(); - AmqpChannelHelpers.ValidateTimeout(timeout); - - try - { - using (AmqpMessage amqpMessage = this.WcfToQpid(message)) - { - this.outputLink.Send(amqpMessage, timeout); - } - } - finally - { - message.Close(); - } - } - - public void Send(Message message) - { - this.Send(message, this.DefaultSendTimeout); - } - - public IAsyncResult BeginSend(Message message, TimeSpan timeout, AsyncCallback callback, object state) - { - this.ThrowIfDisposedOrNotOpen(); - AmqpChannelHelpers.ValidateTimeout(timeout); - - try - { - using (AmqpMessage amqpMessage = this.WcfToQpid(message)) - { - return this.outputLink.BeginSend(amqpMessage, timeout, callback, state); - } - } - finally - { - message.Close(); - } - } - - public IAsyncResult BeginSend(Message message, AsyncCallback callback, object state) - { - return this.BeginSend(message, this.DefaultSendTimeout, callback, state); - } - - public void EndSend(IAsyncResult result) - { - this.outputLink.EndSend(result); - } - - public Message Receive(TimeSpan timeout) - { - Message message; - if (this.TryReceive(timeout, out message)) - { - return message; - } - else - { - throw new TimeoutException("Receive"); - } - } - - public Message Receive() - { - return this.Receive(this.DefaultReceiveTimeout); - } - - public bool TryReceive(TimeSpan timeout, out Message message) - { - AmqpMessage amqpMessage; - message = null; - - if (this.inputLink.TryReceive(timeout, out amqpMessage)) - { - message = this.QpidToWcf(amqpMessage); - return true; - } - - return false; - } - - public IAsyncResult BeginTryReceive(TimeSpan timeout, AsyncCallback callback, object state) - { - return this.inputLink.BeginTryReceive(timeout, callback, state); - } - - public bool EndTryReceive(IAsyncResult result, out Message message) - { - AmqpMessage amqpMessage = null; - if (!this.inputLink.EndTryReceive(result, out amqpMessage)) - { - message = null; - return false; - } - message = QpidToWcf(amqpMessage); - return true; - } - - public bool WaitForMessage(TimeSpan timeout) - { - return this.inputLink.WaitForMessage(timeout); - } - - public IAsyncResult BeginReceive(TimeSpan timeout, AsyncCallback callback, object state) - { - return this.inputLink.BeginTryReceive(timeout, callback, state); - } - - public IAsyncResult BeginReceive(AsyncCallback callback, object state) - { - return this.BeginReceive(this.DefaultReceiveTimeout, callback, state); - } - - public IAsyncResult BeginWaitForMessage(TimeSpan timeout, AsyncCallback callback, object state) - { - return this.inputLink.BeginWaitForMessage(timeout, callback, state); - } - - public Message EndReceive(IAsyncResult result) - { - Message message; - if (this.EndTryReceive(result, out message)) - { - return message; - } - else - { - throw new TimeoutException("EndReceive"); - } - } - - public bool EndWaitForMessage(IAsyncResult result) - { - return this.inputLink.EndWaitForMessage(result); - } - - public void CloseEndPoint() - { - if (this.inputLink != null) - { - this.inputLink.Close(); - } - if (this.outputLink != null) - { - this.outputLink.Close(); - } - } - - /// <summary> - /// Open connection to Broker - /// </summary> - protected override void OnOpen(TimeSpan timeout) - { - // TODO: move open logic to here from constructor - } - - protected override IAsyncResult OnBeginOpen(TimeSpan timeout, AsyncCallback callback, object state) - { - return this.asyncOpenCaller.BeginInvoke(timeout, callback, state); - } - - protected override void OnEndOpen(IAsyncResult result) - { - this.asyncOpenCaller.EndInvoke(result); - } - - protected override void OnAbort() - { - //// TODO: check for network-less qpid teardown or launch special thread - this.CloseEndPoint(); - this.Cleanup(); - } - - /// <summary> - /// Shutdown gracefully - /// </summary> - protected override void OnClose(TimeSpan timeout) - { - this.CloseEndPoint(); - this.Cleanup(); - } - - protected override IAsyncResult OnBeginClose(TimeSpan timeout, AsyncCallback callback, object state) - { - return this.asyncCloseCaller.BeginInvoke(timeout, callback, state); - } - - protected override void OnEndClose(IAsyncResult result) - { - this.asyncCloseCaller.EndInvoke(result); - } - - private AmqpMessage WcfToQpid(Message wcfMessage) - { - object obj; - AmqpProperties applicationProperties = null; - bool success = false; - AmqpMessage amqpMessage = null; - - if (wcfMessage.Properties.TryGetValue("AmqpProperties", out obj)) - { - applicationProperties = obj as AmqpProperties; - } - - try - { - AmqpProperties outgoingProperties = new AmqpProperties(); - - // Start with AMQP properties from the binding and the URI - if (this.factoryChannelProperties.DefaultMessageProperties != null) - { - outgoingProperties.MergeFrom(this.factoryChannelProperties.DefaultMessageProperties); - } - - if (this.subject != null) - { - outgoingProperties.RoutingKey = this.subject; - } - - if (this.qpidSubject != null) - { - outgoingProperties.PropertyMap["qpid.subject"] = new AmqpString(this.qpidSubject); - } - - // Add the Properties set by the application on this particular message. - // Application properties trump channel properties - if (applicationProperties != null) - { - outgoingProperties.MergeFrom(applicationProperties); - } - - amqpMessage = this.outputLink.CreateMessage(); - amqpMessage.Properties = outgoingProperties; - - // copy the WCF message body to the AMQP message body - if (this.streamed) - { - this.encoder.WriteMessage(wcfMessage, amqpMessage.BodyStream); - } - else - { - ArraySegment<byte> encodedBody = this.encoder.WriteMessage(wcfMessage, int.MaxValue, this.bufferManager); - try - { - amqpMessage.BodyStream.Write(encodedBody.Array, encodedBody.Offset, encodedBody.Count); - } - finally - { - this.bufferManager.ReturnBuffer(encodedBody.Array); - } - } - - success = true; - } - finally - { - if (!success && (amqpMessage != null)) - { - amqpMessage.Dispose(); - } - } - return amqpMessage; - } - - - private Message QpidToWcf(AmqpMessage amqpMessage) - { - if (amqpMessage == null) - { - return null; - } - - Message wcfMessage = null; - byte[] managedBuffer = null; - - try - { - if (this.streamed) - { - wcfMessage = this.encoder.ReadMessage(amqpMessage.BodyStream, int.MaxValue); - } - else - { - int count = (int)amqpMessage.BodyStream.Length; - managedBuffer = this.bufferManager.TakeBuffer(count); - int nr = amqpMessage.BodyStream.Read(managedBuffer, 0, count); - ArraySegment<byte> bufseg = new ArraySegment<byte>(managedBuffer, 0, count); - - wcfMessage = this.encoder.ReadMessage(bufseg, this.bufferManager); - - // set to null for finally{} block, since the encoder is now responsible for - // returning the BufferManager memory - managedBuffer = null; - } - - // This message will be discarded unless the "To" header matches - // the WCF endpoint dispatcher's address filter (or the service is - // AddressFilterMode=AddressFilterMode.Any). - - this.remoteAddress.ApplyTo(wcfMessage); - - if (amqpMessage.Properties != null) - { - wcfMessage.Properties.Add("AmqpProperties", amqpMessage.Properties); - } - } - catch (XmlException xmlException) - { - throw new ProtocolException( - "There is a problem with the XML that was received from the network. See inner exception for more details.", - xmlException); - } - catch (Exception e) - { - // TODO: logging - Console.WriteLine("TX channel encoder exception " + e); - } - finally - { - // close the amqpMessage unless the body will be read at a later time. - if (!this.streamed || wcfMessage == null) - { - amqpMessage.Close(); - } - - // the handoff to the encoder failed - if (managedBuffer != null) - { - this.bufferManager.ReturnBuffer(managedBuffer); - } - } - - return wcfMessage; - } - - private void Cleanup() - { - this.bufferManager.Clear(); - } - - private string UriToQpidAddress(Uri uri, out string subject) - { - if (uri.Scheme != AmqpConstants.Scheme) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, - "The scheme {0} specified in address is not supported.", uri.Scheme), "uri"); - } - - subject = ""; - string path = uri.LocalPath; - string query = uri.Query; - - // legacy... convert old style myqueue?routingkey=key to myqueue/key - - if (query.Length > 0) - { - if (!query.StartsWith("?")) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, - "Invalid query argument."), "uri"); - } - - string routingParseKey = "routingkey="; - string subjectParseKey = "subject="; - char[] charSeparators = new char[] { '?', ';' }; - string[] args = uri.Query.Split(charSeparators, StringSplitOptions.RemoveEmptyEntries); - foreach (string s in args) - { - if (s.StartsWith(routingParseKey)) - { - subject = s.Substring(routingParseKey.Length); - } - else if (s.StartsWith(subjectParseKey)) - { - subject = s.Substring(subjectParseKey.Length); - } - else - { - if (s.Length > 0) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, - "Invalid query argument {0}.", s), "uri"); - } - } - } - - if (path.Contains("/")) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, - "Invalid queue name {0}.", path), "uri"); - } - - if (path.Length == 0) - { - // special case, user wants default exchange - return "//" + subject; - } - - return path + "/" + subject; - } - - // find subject in "myqueue/mysubject;{mode:browse}" - int pos = path.IndexOf('/'); - if ((pos > -1) && (pos < path.Length + 1)) - { - subject = path.Substring(pos); - pos = subject.IndexOf(';'); - if (pos == 0) - { - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, - "Empty subject in address {0}.", path), "uri"); - } - - if (pos > 0) - { - subject = subject.Substring(0, pos); - } - } - - if (subject.Length > 0) - { - subject = HttpUtility.UrlDecode(subject); - } - - return HttpUtility.UrlDecode(path); - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportSecurity.cs b/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportSecurity.cs deleted file mode 100644 index b722983ead..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/AmqpTransportSecurity.cs +++ /dev/null @@ -1,101 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Channel
-{
- /// <summary>
- /// This class is used by the AMQP Transport to set transport-level security settings for a binding
- /// </summary>
- public sealed class AmqpTransportSecurity
- {
- private AmqpCredentialType credentialType;
-
- // WCF frowns on unencrypted credentials on the wire, but AMQP is agnostic.
- // For interoperability, allow SSL to be turned on/off independentaly.
- private bool useSSL;
-
- // Allow per channel credentials, but also ease the common case where
- // credentials are shared and wish to be globally set in a config file.
- private AmqpCredential defaultCredential;
-
- // if true, do not look at context for ServiceModel.Description.ClientCredentials.
- // ClientCredentials will be place of choice for WCF traditionalists
- // to specify auth tokens to the AMQP server when Windows and SASL tokens
- // look the same. At other times it makes no sense and sometimes it is
- // confusing with Message-level credentials.
- private bool ignoreEndpointClientCredentials;
-
-
- internal AmqpTransportSecurity()
- {
- this.credentialType = AmqpCredentialType.Anonymous;
- this.useSSL = true;
- }
-
- /// <summary>
- /// gets or sets the SASL mechanism for AMQP authentication between client and server.
- /// </summary>
- public AmqpCredentialType CredentialType
- {
- get { return this.credentialType; }
-
- set { this.credentialType = value; }
- }
-
- /// <summary>
- /// gets or sets the flag that controls the use of SSL encryption
- /// over the network connection.
- /// </summary>
- public bool UseSSL
- {
- get { return this.useSSL; }
- set { this.useSSL = value; }
- }
-
- /// <summary>
- /// gets the default credential object for authentication with the AMQP server.
- /// </summary>
- public AmqpCredential DefaultCredential
- {
- get { return this.defaultCredential; }
- set { this.defaultCredential = value; }
- }
-
- /// <summary>
- /// gets or sets the endpoint ClientCredentials search parameter. If true,
- /// only AmqpCredential objects are searched for in the surrounding context.
- /// </summary>
- public bool IgnoreEndpointClientCredentials
- {
- get { return this.ignoreEndpointClientCredentials; }
- set { this.ignoreEndpointClientCredentials = value; }
- }
-
- internal AmqpTransportSecurity Clone()
- {
- AmqpTransportSecurity sec = (AmqpTransportSecurity)this.MemberwiseClone();
- if (this.defaultCredential != null)
- {
- sec.defaultCredential = this.defaultCredential.Clone();
- }
-
- return sec;
- }
- }
-}
diff --git a/qpid/wcf/src/Apache/Qpid/Channel/Channel.csproj b/qpid/wcf/src/Apache/Qpid/Channel/Channel.csproj deleted file mode 100644 index 1eb811b425..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/Channel.csproj +++ /dev/null @@ -1,112 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{8AABAB30-7D1E-4539-B7D1-05450262BAD2}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Channel</RootNamespace>
- <AssemblyName>Apache.Qpid.Channel</AssemblyName>
- <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
- <FileAlignment>512</FileAlignment>
- <StartupObject>
- </StartupObject>
- <SignAssembly>true</SignAssembly>
- <AssemblyOriginatorKeyFile>..\..\..\wcfnet.snk</AssemblyOriginatorKeyFile>
- </PropertyGroup>
- <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
- <DebugSymbols>true</DebugSymbols>
- <DebugType>full</DebugType>
- <Optimize>false</Optimize>
- <OutputPath>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <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>
- -->
- <ItemGroup>
- <Compile Include="AmqpBinaryBinding.cs" />
- <Compile Include="AmqpBinaryBindingCollectionElement.cs" />
- <Compile Include="AmqpBinaryBindingConfigurationElement.cs" />
- <Compile Include="AmqpCredential.cs" />
- <Compile Include="AmqpCredentialType.cs" />
- <Compile Include="AmqpSecurity.cs" />
- <Compile Include="AmqpSecurityElement.cs" />
- <Compile Include="AmqpSecurityMode.cs" />
- <Compile Include="AmqpChannelFactory.cs" />
- <Compile Include="AmqpChannelHelpers.cs" />
- <Compile Include="AmqpChannelListener.cs" />
- <Compile Include="AmqpBinding.cs" />
- <Compile Include="AmqpBindingCollectionElement.cs" />
- <Compile Include="AmqpBindingConfigurationElement.cs" />
- <Compile Include="AmqpTransportBindingElement.cs" />
- <Compile Include="AmqpTransportChannel.cs" />
- <Compile Include="AmqpTransportSecurity.cs" />
- <Compile Include="ConnectionManager.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="RawMessage.cs" />
- <Compile Include="RawMessageEncoder.cs" />
- <Compile Include="RawMessageEncoderFactory.cs" />
- <Compile Include="RawMessageEncodingBindingElement.cs" />
- <Compile Include="RawXmlReader.cs" />
- <Compile Include="RawXmlWriter.cs" />
- </ItemGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.configuration" />
- <Reference Include="System.Runtime.Serialization">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Transactions" />
- <Reference Include="System.Web" />
- <Reference Include="System.XML" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\Interop\Interop.vcproj">
- <Project>{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}</Project>
- <Name>Interop</Name>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <None Include="..\..\..\wcfnet.snk" />
- </ItemGroup>
-</Project>
\ No newline at end of file diff --git a/qpid/wcf/src/Apache/Qpid/Channel/ConnectionManager.cs b/qpid/wcf/src/Apache/Qpid/Channel/ConnectionManager.cs deleted file mode 100644 index 7238ff2120..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/ConnectionManager.cs +++ /dev/null @@ -1,329 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.Collections; - using System.Collections.Generic; - using System.Text; - using System.Threading; - - using Apache.Qpid.Interop; - - // The ConnectionManager looks after a shareable pool of AmqpConnection and AmqpSession - // objects. If two connection requests could be shared (see MakeKey() properties), and - // are designated as shareable, then they will be paired up. Each shared connection is - // a separate instance of a ManagedConnection. All unshared connections use a single - // instance of ManagedConnection with locking turned off. The ManagedConnection object - // registers for notifictation when a connection goes idle (all grandchild InputLink and - // OutputLink objects have been closed), and closes the connection. - - // TODO: the session sharing is roughed-in via comments but needs completing. - - internal sealed class ConnectionManager - { - // A side effect of creating InputLinks and OutputLinks is that counters - // in the respective AmqpSession and AmqpConnection are updated, so care - // must be taken to hold the lock across acquiring a session and opening - // a link on it. - - // one for each shared connection - private static Dictionary<string, ManagedConnection> sharedInstances; - - // this one creates and releases connections that are not shared. No locking required. - private static ManagedConnection unsharedInstance; - - // lock for finding or creating ManagedConnection instances - private static Object connectionLock; - - static ConnectionManager() - { - unsharedInstance = null; - sharedInstances = new Dictionary<string, ManagedConnection>(); - connectionLock = new Object(); - } - - private static string MakeKey(AmqpChannelProperties props) - { - StringBuilder sb = new StringBuilder(); - sb.Append(props.BrokerHost); - sb.Append(':'); - sb.Append(props.BrokerPort); - sb.Append(':'); - sb.Append(props.TransferMode); - - AmqpTransportSecurity sec = props.AmqpTransportSecurity; - if (sec == null) - { - return sb.ToString(); - } - - if (sec.UseSSL) - { - sb.Append(":SSL"); - } - - if (sec.CredentialType == AmqpCredentialType.Plain) - { - sb.Append(":saslP"); - AmqpCredential cred = props.AmqpCredential; - if (cred != null) - { - sb.Append(":NM:"); - sb.Append(cred.UserName); - sb.Append(":PW:"); - sb.Append(cred.Password); - } - } - - return sb.ToString(); - } - - private static ManagedConnection GetManagedConnection(AmqpChannelProperties channelProperties, bool connectionSharing) - { - if (connectionSharing) - { - string key = MakeKey(channelProperties); - lock (connectionLock) - { - ManagedConnection mc = null; - if (!sharedInstances.TryGetValue(key, out mc)) - { - mc = new ManagedConnection(true); - sharedInstances.Add(key, mc); - } - return mc; - } - } - else - { - lock (connectionLock) - { - if (unsharedInstance == null) - { - unsharedInstance = new ManagedConnection(false); - } - return unsharedInstance; - } - } - } - - public static OutputLink GetOutputLink(AmqpChannelProperties channelProperties, bool connectionSharing, bool sessionSharing, string qname) - { - ManagedConnection mc = GetManagedConnection(channelProperties, connectionSharing); - return (OutputLink)mc.GetLink(channelProperties, sessionSharing, null, qname); - } - - public static InputLink GetInputLink(AmqpChannelProperties channelProperties, bool connectionSharing, bool sessionSharing, string qname) - { - ManagedConnection mc = GetManagedConnection(channelProperties, connectionSharing); - return (InputLink)mc.GetLink(channelProperties, sessionSharing, qname, null); - } - - - - class ManagedConnection - { - private Boolean shared; - private AmqpConnection sharedConnection; - //private Dictionary<string, AmqpSession> sharedSessions; - - public ManagedConnection(bool shared) - { - this.shared = shared; - } - - - public object GetLink(AmqpChannelProperties channelProperties, bool sessionSharing, string inputQueue, string outputQueue) - { - AmqpConnection connection = null; - AmqpSession session = null; - Object link = null; - bool newConnection = false; - //bool newSession = false; - bool success = false; - - // when called in the non-shared case, only stack variables should be used for holding connections/sessions/links - - if (this.shared) - { - Monitor.Enter(this); // lock - } - - try - { - if (this.shared) - { - // TODO: check shared connection not closed (i.e. network drop) and refresh this instance if needed - if (sessionSharing) - { - throw new NotImplementedException("shared session"); - /* * ... once we have a defined shared session config parameter: - - // lazilly create - if (this.sharedSessions == null) - { - this.sharedSessions = new Dictionary<string, AmqpSession>(); - } - - alreadydeclaredstring sessionKey = channelProperties.name_of_key_goes_here; - this.sharedSessions.TryGetValue(sessionKey, out session); - - * */ - } - - if (this.sharedConnection != null) - { - connection = this.sharedConnection; - } - } - - if (connection == null) - { - if (channelProperties.AmqpSecurityMode != AmqpSecurityMode.None) - { - string user = null; - string passwd = null; - bool ssl = false; - bool saslPlain = false; - - AmqpTransportSecurity tsec = channelProperties.AmqpTransportSecurity; - if (tsec.UseSSL) - { - ssl = true; - } - - if (tsec.CredentialType == AmqpCredentialType.Plain) - { - saslPlain = true; - AmqpCredential plainCred = channelProperties.AmqpCredential; - if (plainCred != null) - { - user = plainCred.UserName; - passwd = plainCred.Password; - } - } - - connection = new AmqpConnection(channelProperties.BrokerHost, channelProperties.BrokerPort, - ssl, saslPlain, user, passwd); - } - else - { - connection = new AmqpConnection(channelProperties.BrokerHost, channelProperties.BrokerPort); - } - - newConnection = true; - if (this.shared) - { - connection.OnConnectionIdle += new ConnectionIdleEventHandler(this.IdleConnectionHandler); - } - else - { - connection.OnConnectionIdle += new ConnectionIdleEventHandler(UnsharedIdleConnectionHandler); - } - } - - if (session == null) - { - session = connection.CreateSession(); - //newSession = true; - } - - if (inputQueue != null) - { - link = session.CreateInputLink(inputQueue); - } - else - { - link = session.CreateOutputLink(outputQueue); - } - - if (this.shared) - { - if (newConnection) - { - this.sharedConnection = connection; - } - /* - if (newSession) - { - sharedSessions.Add(foo, session); - } - * */ - } - - success = true; - } - finally - { - if (this.shared) - { - Monitor.Exit(this); - } - if (!success) - { - /* - if (newSession) - { - session.Close(); - } - */ - if (newConnection) - { - connection.Close(); - } - } - } - - return link; - } - - - static void UnsharedIdleConnectionHandler(Object sender, EventArgs empty) - { - if (sender is AmqpConnection) - { - AmqpConnection connection = (AmqpConnection)sender; - connection.Close(); - } - } - - void IdleConnectionHandler(Object sender, EventArgs empty) - { - lock (this) - { - if (sharedConnection != sender || sharedConnection == null) - { - return; - } - if (!sharedConnection.IsIdle) - { - // Another thread made the connection busy again. - // That's OK. Another idle event will come along later. - return; - } - sharedConnection.Close(); // also closes all child sessions - sharedConnection = null; - //sharedSessions = null; - } - } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/Properties/AssemblyInfo.cs b/qpid/wcf/src/Apache/Qpid/Channel/Properties/AssemblyInfo.cs deleted file mode 100644 index edd9a056a7..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* -* 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.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("Apache.Qpid.Channel")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to true makes the types in this assembly visible -// to COM components. This is required for this to be used by an -// Excel RTD component. -[assembly: ComVisible(true)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("ac02bbb0-2c19-43fb-a36c-b1b0a50eaf1a")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/qpid/wcf/src/Apache/Qpid/Channel/RawMessage.cs b/qpid/wcf/src/Apache/Qpid/Channel/RawMessage.cs deleted file mode 100644 index 5925fa47dc..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/RawMessage.cs +++ /dev/null @@ -1,374 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.IO; - using System.ServiceModel.Channels; - using System.Xml; - - // This incoming Message is backed either by a Stream (bodyStream) or a byte array (bodyBytes). - // If bodyBytes belongs to a BufferManager, we must return it when done. - // The pay-off is OnGetReaderAtBodyContents(). - // Most of the complexity is dealing with the OnCreateBufferedCopy() machinery. - internal class RawMessage : Message - { - private MessageHeaders headers; - private MessageProperties properties; - private XmlDictionaryReaderQuotas readerQuotas; - private Stream bodyStream; - private byte[] bodyBytes; - private int index; - private int count; - private BufferManager bufferManager; - - public RawMessage(byte[] buffer, int index, int count, BufferManager bufferManager, XmlDictionaryReaderQuotas quotas) - { - // this constructor supports MessageEncoder.ReadMessage(ArraySegment<byte> b, BufferManager mgr, string contentType) - if (quotas == null) - { - quotas = new XmlDictionaryReaderQuotas(); - } - - this.headers = new MessageHeaders(MessageVersion.None); - this.properties = new MessageProperties(); - this.readerQuotas = quotas; - this.bodyBytes = buffer; - this.index = index; - this.count = count; - this.bufferManager = bufferManager; - } - - public RawMessage(Stream stream, XmlDictionaryReaderQuotas quotas) - { - // this constructor supports MessageEncoder.ReadMessage(System.IO.Stream s, int max, string contentType) - if (quotas == null) - { - quotas = new XmlDictionaryReaderQuotas(); - } - - this.headers = new MessageHeaders(MessageVersion.None); - this.properties = new MessageProperties(); - this.bodyStream = stream; - } - - public RawMessage(MessageHeaders headers, MessageProperties properties, byte[] bytes, int index, int count, XmlDictionaryReaderQuotas quotas) - { - // this constructor supports internal needs for CreateBufferedCopy().CreateMessage() - this.headers = new MessageHeaders(headers); - this.properties = new MessageProperties(properties); - this.bodyBytes = bytes; - this.index = index; - this.count = count; - this.readerQuotas = quotas; - } - - public override MessageHeaders Headers - { - get - { - if (this.IsDisposed) - { - throw new ObjectDisposedException("message"); - } - - return this.headers; - } - } - - public override bool IsEmpty - { - get - { - if (this.IsDisposed) - { - throw new ObjectDisposedException("message"); - } - - return false; - } - } - - public override bool IsFault - { - get - { - if (this.IsDisposed) - { - throw new ObjectDisposedException("message"); - } - - return false; - } - } - - public override MessageProperties Properties - { - get - { - if (this.IsDisposed) - { - throw new ObjectDisposedException("message"); - } - - return this.properties; - } - } - - public override MessageVersion Version - { - get - { - if (this.IsDisposed) - { - throw new ObjectDisposedException("message"); - } - - return MessageVersion.None; - } - } - - protected override void OnBodyToString(XmlDictionaryWriter writer) - { - if (this.bodyStream != null) - { - writer.WriteString("Stream"); - } - else - { - writer.WriteStartElement(RawMessageEncoder.StreamElementName, string.Empty); - writer.WriteBase64(this.bodyBytes, this.index, this.count); - writer.WriteEndElement(); - } - } - - protected override void OnClose() - { - Exception deferEx = null; - try - { - base.OnClose(); - } - catch (Exception e) - { - deferEx = e; - } - - try - { - if (this.properties != null) - { - this.properties.Dispose(); - } - } - catch (Exception e) - { - if (deferEx == null) - { - deferEx = e; - } - } - - try - { - if (this.bufferManager != null) - { - this.bufferManager.ReturnBuffer(this.bodyBytes); - this.bufferManager = null; - } - } - catch (Exception e) - { - if (deferEx == null) - { - deferEx = e; - } - } - - if (deferEx != null) - { - throw deferEx; - } - } - - protected override MessageBuffer OnCreateBufferedCopy(int maxBufferSize) - { - if (this.bodyStream != null) - { - int len = (int)this.bodyStream.Length; - byte[] buf = new byte[len]; - this.bodyStream.Read(buf, 0, len); - this.bodyStream = null; - this.bodyBytes = buf; - this.count = len; - this.index = 0; - } - else - { - if (this.bufferManager != null) - { - // we could take steps to share the buffer among copies and release the memory - // after the last user finishes by a reference count or such, but we are already - // far from the intended optimized use. Make one GC managed memory copy that is - // shared by all. - byte[] buf = new byte[this.count]; - - Buffer.BlockCopy(this.bodyBytes, this.index, buf, 0, this.count); - this.bufferManager.ReturnBuffer(this.bodyBytes); - this.bufferManager = null; - this.bodyBytes = buf; - this.index = 0; - } - } - - return new RawMessageBuffer(this.headers, this.properties, this.bodyBytes, this.index, this.count, this.readerQuotas); - } - - protected override XmlDictionaryReader OnGetReaderAtBodyContents() - { - Stream readerStream = null; - bool ownsStream; - - if (this.bodyStream != null) - { - readerStream = this.bodyStream; - ownsStream = false; - } - else - { - // create stream for duration of XmlReader. - ownsStream = true; - if (this.bufferManager != null) - { - readerStream = new RawMemoryStream(this.bodyBytes, this.index, this.count, this.bufferManager); - this.bufferManager = null; - } - else - { - readerStream = new MemoryStream(this.bodyBytes, this.index, this.count, false); - } - } - - return new RawXmlReader(readerStream, this.readerQuotas, ownsStream); - } - - protected override void OnWriteBodyContents(XmlDictionaryWriter writer) - { - writer.WriteStartElement(RawMessageEncoder.StreamElementName, string.Empty); - if (this.bodyStream != null) - { - int len = (int)this.bodyStream.Length; - byte[] buf = new byte[len]; - this.bodyStream.Read(buf, 0, len); - writer.WriteBase64(buf, 0, len); - } - else - { - writer.WriteBase64(this.bodyBytes, this.index, this.count); - } - - writer.WriteEndElement(); - } - - private class RawMemoryStream : MemoryStream - { - private BufferManager bufferManager; - private byte[] buffer; - - public RawMemoryStream(byte[] bytes, int index, int count, BufferManager mgr) - : base(bytes, index, count, false) - { - this.bufferManager = mgr; - this.buffer = bytes; - } - - protected override void Dispose(bool disposing) - { - if (this.bufferManager != null) - { - try - { - this.bufferManager.ReturnBuffer(this.buffer); - } - finally - { - this.bufferManager = null; - base.Dispose(disposing); - } - } - } - } - - private class RawMessageBuffer : MessageBuffer - { - private bool closed; - private MessageHeaders headers; - private MessageProperties properties; - private byte[] bodyBytes; - private int index; - private int count; - private XmlDictionaryReaderQuotas readerQuotas; - - public RawMessageBuffer(MessageHeaders headers, MessageProperties properties, byte[] bytes, int index, int count, XmlDictionaryReaderQuotas quotas) - : base() - { - this.headers = new MessageHeaders(headers); - this.properties = new MessageProperties(properties); - this.bodyBytes = bytes; - this.index = index; - this.count = count; - this.readerQuotas = new XmlDictionaryReaderQuotas(); - quotas.CopyTo(this.readerQuotas); - } - - public override int BufferSize - { - get { return this.count; } - } - - public override void Close() - { - if (!this.closed) - { - this.closed = true; - this.headers = null; - if (this.properties != null) - { - this.properties.Dispose(); - this.properties = null; - } - - this.bodyBytes = null; - this.readerQuotas = null; - } - } - - public override Message CreateMessage() - { - if (this.closed) - { - throw new ObjectDisposedException("message"); - } - - return new RawMessage(this.headers, this.properties, this.bodyBytes, this.index, this.count, this.readerQuotas); - } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/RawMessageEncoder.cs b/qpid/wcf/src/Apache/Qpid/Channel/RawMessageEncoder.cs deleted file mode 100644 index 76dae6f6c7..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/RawMessageEncoder.cs +++ /dev/null @@ -1,113 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.IO; - using System.ServiceModel.Channels; - using System.ServiceModel; - using System.Xml; - - - class RawMessageEncoder : MessageEncoder - { - public const string StreamElementName = "Binary"; - - XmlDictionaryReaderQuotas readerQuotas; - - public RawMessageEncoder(XmlDictionaryReaderQuotas quotas) - { - this.readerQuotas = new XmlDictionaryReaderQuotas(); - if (quotas != null) - { - quotas.CopyTo(this.readerQuotas); - } - } - - public override string ContentType - { - get { return null; } - } - - public override bool IsContentTypeSupported(string contentType) - { - return true; - } - - public override string MediaType - { - get { return null; } - } - - public override MessageVersion MessageVersion - { - get { return MessageVersion.None; } - } - - public override Message ReadMessage(ArraySegment<byte> buffer, BufferManager bufferManager, string contentType) - { - RawMessage message = new RawMessage(buffer.Array, buffer.Offset, buffer.Count, bufferManager, readerQuotas); - message.Properties.Encoder = this; - return message; - } - - public override Message ReadMessage(Stream stream, int maxSizeOfHeaders, string contentType) - { - RawMessage message = new RawMessage(stream, readerQuotas); - message.Properties.Encoder = this; - return message; - } - - private void CheckType(XmlDictionaryReader reader, XmlNodeType type) - { - if (reader.NodeType != type) - { - throw new System.IO.InvalidDataException(String.Format("RawMessageEncoder xml check {0} type should be {1}", type, reader.NodeType)); - } - } - - public override ArraySegment<byte> WriteMessage(Message message, int maxMessageSize, BufferManager bufferManager, int messageOffset) - { - MemoryStream tempStream = new MemoryStream(); - this.WriteMessage(message, tempStream); - int len = messageOffset + (int)tempStream.Length; - byte[] buf = bufferManager.TakeBuffer(len); - MemoryStream targetStream = new MemoryStream(buf); - if (messageOffset > 0) - { - targetStream.Seek(messageOffset, SeekOrigin.Begin); - } - - tempStream.WriteTo(targetStream); - targetStream.Close(); - - return new ArraySegment<byte>(buf, messageOffset, len - messageOffset); - } - - public override void WriteMessage(Message message, Stream stream) - { - using (XmlWriter writer = new RawXmlWriter(stream)) - { - message.WriteMessage(writer); - writer.Flush(); - } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/RawMessageEncoderFactory.cs b/qpid/wcf/src/Apache/Qpid/Channel/RawMessageEncoderFactory.cs deleted file mode 100644 index 5c015f9a1b..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/RawMessageEncoderFactory.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.Xml; - using System.ServiceModel.Channels; - - internal class RawMessageEncoderFactory : MessageEncoderFactory - { - RawMessageEncoder encoder; - - public RawMessageEncoderFactory(XmlDictionaryReaderQuotas quotas) - { - this.encoder = new RawMessageEncoder(quotas); - } - - public override MessageEncoder Encoder - { - get { return this.encoder; } - } - - public override MessageVersion MessageVersion - { - get { return encoder.MessageVersion; } - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/RawMessageEncodingBindingElement.cs b/qpid/wcf/src/Apache/Qpid/Channel/RawMessageEncodingBindingElement.cs deleted file mode 100644 index 5ec10a976d..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/RawMessageEncodingBindingElement.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.ServiceModel.Channels; - - public class RawMessageEncodingBindingElement : MessageEncodingBindingElement - { - - public RawMessageEncodingBindingElement() - : base() - { - } - - RawMessageEncodingBindingElement(RawMessageEncodingBindingElement originalBindingElement) - { - } - - public override MessageEncoderFactory CreateMessageEncoderFactory() - { - return new RawMessageEncoderFactory(null); - } - - - public override IChannelFactory<TChannel> BuildChannelFactory<TChannel>(BindingContext context) - { - if (context == null) - throw new ArgumentNullException("context"); - - context.BindingParameters.Add(this); - return context.BuildInnerChannelFactory<TChannel>(); - } - - public override bool CanBuildChannelFactory<TChannel>(BindingContext context) - { - if (context == null) - throw new ArgumentNullException("context"); - - return context.CanBuildInnerChannelFactory<TChannel>(); - } - - public override IChannelListener<TChannel> BuildChannelListener<TChannel>(BindingContext context) - { - if (context == null) - throw new ArgumentNullException("context"); - - context.BindingParameters.Add(this); - return context.BuildInnerChannelListener<TChannel>(); - } - - public override bool CanBuildChannelListener<TChannel>(BindingContext context) - { - if (context == null) - throw new ArgumentNullException("context"); - - context.BindingParameters.Add(this); - return context.CanBuildInnerChannelListener<TChannel>(); - } - - - public override BindingElement Clone() - { - return new RawMessageEncodingBindingElement(this); - } - - - - public override MessageVersion MessageVersion - { - get - { - return MessageVersion.None; - } - - set - { - if (value != MessageVersion.None) - throw new ArgumentException("Unsupported message version"); - } - } - - - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/RawXmlReader.cs b/qpid/wcf/src/Apache/Qpid/Channel/RawXmlReader.cs deleted file mode 100644 index 8fadfce441..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/RawXmlReader.cs +++ /dev/null @@ -1,353 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.IO; - using System.Xml; - - internal class RawXmlReader : XmlDictionaryReader - { - ////this class presents a hardcoded XML InfoSet: "<rawtag>X</rawtag>" where X is the entire stream content - - private Stream stream; - private bool closed; - private bool streamOwner; - private ReaderPosition position; - private string contentAsBase64; - private XmlNameTable xmlNameTable; - private XmlDictionaryReaderQuotas readerQuotas; - - public RawXmlReader(Stream stream, XmlDictionaryReaderQuotas quotas, bool streamOwner) - { - this.stream = stream; - this.streamOwner = streamOwner; - if (quotas == null) - { - this.readerQuotas = new XmlDictionaryReaderQuotas(); - } - else - { - this.readerQuotas = quotas; - } - } - - private enum ReaderPosition - { - None, - StartElement, - Content, - EndElement, - EOF - } - - public override int AttributeCount - { - get { return 0; } - } - - public override string BaseURI - { - get { return string.Empty; } - } - - public override int Depth - { - get { return (this.position == ReaderPosition.Content) ? 1 : 0; } - } - - public override bool EOF - { - get { return this.position == ReaderPosition.EOF; } - } - - public override bool HasAttributes - { - get { return false; } - } - - public override bool HasValue - { - get { return this.position == ReaderPosition.Content; } - } - - public override bool IsEmptyElement - { - get { return false; } - } - - public override string LocalName - { - get - { - if (this.position == ReaderPosition.StartElement) - { - return RawMessageEncoder.StreamElementName; - } - - return null; - } - } - - public override string NamespaceURI - { - get { return string.Empty; } - } - - public override XmlNameTable NameTable - { - get - { - if (this.xmlNameTable == null) - { - this.xmlNameTable = new NameTable(); - this.xmlNameTable.Add(RawMessageEncoder.StreamElementName); - } - - return this.xmlNameTable; - } - } - - public override XmlNodeType NodeType - { - get - { - switch (this.position) - { - case ReaderPosition.StartElement: - return XmlNodeType.Element; - case ReaderPosition.Content: - return XmlNodeType.Text; - case ReaderPosition.EndElement: - return XmlNodeType.EndElement; - default: - // and StreamPosition.EOF - return XmlNodeType.None; - } - } - } - - public override string Prefix - { - get { return string.Empty; } - } - - public override ReadState ReadState - { - get - { - switch (this.position) - { - case ReaderPosition.None: - return ReadState.Initial; - case ReaderPosition.StartElement: - case ReaderPosition.Content: - case ReaderPosition.EndElement: - return ReadState.Interactive; - case ReaderPosition.EOF: - return ReadState.Closed; - default: - return ReadState.Error; - } - } - } - - public override string Value - { - get - { - switch (this.position) - { - case ReaderPosition.Content: - if (this.contentAsBase64 == null) - { - this.contentAsBase64 = Convert.ToBase64String(this.ReadContentAsBase64()); - } - - return this.contentAsBase64; - - default: - return string.Empty; - } - } - } - - public override void Close() - { - if (!this.closed) - { - this.closed = true; - this.position = ReaderPosition.EOF; - this.readerQuotas = null; - if (this.streamOwner) - { - this.stream.Close(); - } - } - } - - public override string GetAttribute(int i) - { - throw new ArgumentOutOfRangeException("i", i, "Argument not in set of valid values"); - } - - public override string GetAttribute(string name, string namespaceURI) - { - return null; - } - - public override string GetAttribute(string name) - { - return null; - } - - public override string LookupNamespace(string prefix) - { - if (prefix == string.Empty) - { - return string.Empty; - } - else if (prefix == "xml") - { - return "http://www.w3.org/XML/1998/namespace"; - } - else if (prefix == "xmlns") - { - return "http://www.w3.org/2000/xmlns/"; - } - else - { - return null; - } - } - - public override bool MoveToAttribute(string name, string ns) - { - return false; - } - - public override bool MoveToAttribute(string name) - { - return false; - } - - public override bool MoveToElement() - { - if (this.position == ReaderPosition.None) - { - this.position = ReaderPosition.StartElement; - return true; - } - - return false; - } - - public override bool MoveToFirstAttribute() - { - return false; - } - - public override bool MoveToNextAttribute() - { - return false; - } - - public override bool Read() - { - switch (this.position) - { - case ReaderPosition.None: - this.position = ReaderPosition.StartElement; - return true; - case ReaderPosition.StartElement: - this.position = ReaderPosition.Content; - return true; - case ReaderPosition.Content: - this.position = ReaderPosition.EndElement; - return true; - case ReaderPosition.EndElement: - this.position = ReaderPosition.EOF; - return false; - case ReaderPosition.EOF: - return false; - default: - return false; - } - } - - public override bool ReadAttributeValue() - { - return false; - } - - public override int ReadContentAsBase64(byte[] buffer, int index, int count) - { - if (buffer == null) - { - throw new ArgumentNullException("buffer"); - } - - if (this.position != ReaderPosition.Content) - { - throw new InvalidOperationException("XML reader not in Element"); - } - - if (count == 0) - { - return 0; - } - - int readCount = this.stream.Read(buffer, index, count); - if (readCount == 0) - { - this.position = ReaderPosition.EndElement; - } - - return readCount; - } - - public override int ReadContentAsBinHex(byte[] buffer, int index, int count) - { - throw new NotSupportedException(); - } - - public override void ResolveEntity() - { - throw new NotSupportedException(); - } - - public override bool TryGetBase64ContentLength(out int length) - { - // The whole stream is this one element - if (!this.closed && this.stream.CanSeek) - { - long streamLength = this.stream.Length; - if (streamLength <= int.MaxValue) - { - length = (int)streamLength; - return true; - } - } - - length = -1; - return false; - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/Channel/RawXmlWriter.cs b/qpid/wcf/src/Apache/Qpid/Channel/RawXmlWriter.cs deleted file mode 100644 index 7d05b70807..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Channel/RawXmlWriter.cs +++ /dev/null @@ -1,221 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Channel -{ - using System; - using System.IO; - using System.Xml; - - internal sealed class RawXmlWriter : XmlDictionaryWriter - { - - WriteState state; - Stream stream; - bool closed; - bool rawWritingEnabled; - - public RawXmlWriter(Stream stream) - { - if (stream == null) - { - throw new ArgumentNullException("Stream"); - } - - this.stream = stream; - this.state = WriteState.Start; - } - - public override WriteState WriteState - { - get - { - return this.state; - } - } - - public override void Close() - { - if (!this.closed) - { - this.closed = true; - this.state = WriteState.Closed; - this.rawWritingEnabled = false; - } - } - - public override void Flush() - { - this.ThrowIfClosed(); - this.stream.Flush(); - } - - public override string LookupPrefix(string ns) - { - return null; - } - - public override void WriteBase64(byte[] buffer, int index, int count) - { - if (buffer == null) - { - throw new ArgumentNullException("buffer"); - } - - ThrowIfClosed(); - - if (!this.rawWritingEnabled) - { - throw new InvalidOperationException("XmlWriter not in Element"); - } - - this.stream.Write(buffer, index, count); - this.state = WriteState.Content; - } - - public override void WriteStartElement(string prefix, string localName, string ns) - { - ThrowIfClosed(); - if (this.state != WriteState.Start) - { - throw new InvalidOperationException("Start Element Already Called"); - } - - if (!string.IsNullOrEmpty(prefix) || !string.IsNullOrEmpty(ns) || localName != RawMessageEncoder.StreamElementName) - { - throw new XmlException("Wrong XML Start Element Name"); - } - this.state = WriteState.Element; - this.rawWritingEnabled = true; - } - - public override void WriteEndElement() - { - ThrowIfClosed(); - if (!this.rawWritingEnabled) - { - throw new InvalidOperationException("Unexpected End Element"); - } - this.rawWritingEnabled = false; - } - - public override void WriteFullEndElement() - { - this.WriteEndElement(); - } - - public override void WriteEndDocument() - { - this.rawWritingEnabled = false; - this.ThrowIfClosed(); - } - - public override void WriteStartDocument() - { - this.rawWritingEnabled = false; - this.ThrowIfClosed(); - } - - public override void WriteStartDocument(bool standalone) - { - this.rawWritingEnabled = false; - this.ThrowIfClosed(); - } - - private void ThrowIfClosed() - { - if (this.closed) - { - throw new InvalidOperationException("XML Writer closed"); - } - } - - - public override void WriteString(string text) - { - throw new NotSupportedException(); - } - - public override void WriteCData(string text) - { - throw new NotSupportedException(); - } - - public override void WriteCharEntity(char ch) - { - throw new NotSupportedException(); - } - - public override void WriteChars(char[] buffer, int index, int count) - { - throw new NotSupportedException(); - } - - public override void WriteComment(string text) - { - throw new NotSupportedException(); - } - - public override void WriteDocType(string name, string pubid, string sysid, string subset) - { - throw new NotSupportedException(); - } - - public override void WriteEndAttribute() - { - throw new NotSupportedException(); - } - - public override void WriteEntityRef(string name) - { - throw new NotSupportedException(); - } - - - public override void WriteProcessingInstruction(string name, string text) - { - throw new NotSupportedException(); - } - - public override void WriteRaw(string data) - { - throw new NotSupportedException(); - } - - public override void WriteRaw(char[] buffer, int index, int count) - { - throw new NotSupportedException(); - } - - public override void WriteStartAttribute(string prefix, string localName, string ns) - { - throw new NotSupportedException(); - } - - public override void WriteSurrogateCharEntity(char lowChar, char highChar) - { - throw new NotSupportedException(); - } - - public override void WriteWhitespace(string ws) - { - throw new NotSupportedException(); - } - } -} diff --git a/qpid/wcf/src/Apache/Qpid/DtcPlugin/DtcPlugin.cpp b/qpid/wcf/src/Apache/Qpid/DtcPlugin/DtcPlugin.cpp deleted file mode 100644 index ec98289923..0000000000 --- a/qpid/wcf/src/Apache/Qpid/DtcPlugin/DtcPlugin.cpp +++ /dev/null @@ -1,797 +0,0 @@ -/*
-* 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.
-*/
-
-
-//
-// This module provides the backend recovery driver for Windows resource managers based on
-// the IDtcToXaHelperSinglePipe interface. The dll is loaded (LoadLibrary) directly into DTC
-// itself and runs at a different protection level from the resource manager instance, which
-// runs inside the application.
-//
-// The DTC dynamically loads this file, calls GetXaSwitch() to access the XA interface
-// implementation and unloads the dll when done.
-//
-// This DTC plugin is only called for registration and recovery. Each time the application
-// registers the Qpid resource manager with DTC, the plugin is loaded and a successful
-// connection via xa_open is confirmed before completing registration and saving the DSN
-// connection string in the DTC log for possible recovery. On recovery, the DSN is re-used to
-// re-establish a new connection with the broker and perform recovery.
-//
-// Because this plugin is not involved in coordinating any active transactions it only needs to
-// partially implement the XA interface.
-//
-// For the same reason, the locking strategy is simple. A single global lock is used.
-// Whenever networking activity is about to take place, the lock is relinquished and retaken
-// soon thereafter.
-
-
-#include <windows.h>
-#include <transact.h>
-#include <xolehlp.h>
-#include <txdtc.h>
-#include <xa.h>
-
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/Connection.h"
-#include "qpid/framing/FieldValue.h"
-
-
-#include <map>
-#include <iostream>
-#include <fstream>
-
-namespace Apache {
-namespace Qpid {
-namespace DtcPlugin {
-
-using namespace qpid::client;
-using namespace qpid::framing;
-using namespace qpid::framing::dtx;
-
-class ResourceManager
-{
-private:
- Connection qpidConnection;
- Session qpidSession;
- bool active;
- std::string host;
- int port;
- std::string username;
- std::string password;
- bool ssl;
- bool saslPlain;
-
- int rmid;
- std::vector<qpid::framing::Xid> inDoubtXids;
- // current scan position, or -1 if no scan
- int cursor;
-public:
- ResourceManager(int id, std::string h, int p, bool sslP, bool saslPlainP, std::string uname, std::string pass)
- : rmid(id), host(h), port(p), ssl(sslP), saslPlain(saslPlainP), username(uname), password(pass),
- active(false), cursor(-1) {}
- ~ResourceManager() {}
- INT open();
- INT close();
- INT commit(XID *xid);
- INT rollback(XID *xid);
- INT recover(XID *xids, long count, long flags);
-};
-
-
-CRITICAL_SECTION rmLock;
-
-std::map<int, ResourceManager*> rmMap;
-HMODULE thisDll = NULL;
-bool memLocked = false;
-
-#define QPIDHMCHARS 512
-
-
-void pinDll() {
- if (!memLocked) {
- char thisDllName[QPIDHMCHARS];
- HMODULE ignore;
-
- DWORD nc = GetModuleFileName(thisDll, thisDllName, QPIDHMCHARS);
- if ((nc > 0) && (nc < QPIDHMCHARS)) {
- memLocked = GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_PIN, thisDllName, &ignore);
- }
- }
-}
-
-
-void XaToQpid(XID &winXid, Xid &qpidXid) {
- // convert from XA defined structure XID to the Qpid framing structure
- qpidXid.setFormat((uint32_t) winXid.formatID);
- int bqualPos = 0;
- if (winXid.gtrid_length > 0) {
- qpidXid.setGlobalId(std::string(winXid.data, winXid.gtrid_length));
- bqualPos = winXid.gtrid_length;
- }
- if (winXid.bqual_length > 0) {
- qpidXid.setBranchId(std::string(winXid.data + bqualPos, winXid.bqual_length));
- }
-}
-
-
-// this function assumes that the qpidXid has already been validated for the memory copy
-
-void QpidToXa(Xid &qpidXid, XID &winXid) {
- // convert from the Qpid framing structure to the XA defined structure XID
- winXid.formatID = qpidXid.getFormat();
-
- const std::string& global_s = qpidXid.getGlobalId();
- size_t gl = global_s.size();
- winXid.gtrid_length = (long) gl;
- if (gl > 0)
- global_s.copy(winXid.data, gl);
-
- const std::string branch_s = qpidXid.getBranchId();
- size_t bl = branch_s.size();
- winXid.bqual_length = (long) bl;
- if (bl > 0)
- branch_s.copy(winXid.data + gl, bl);
-}
-
-
-static char *dsnHeader = "QPIDdsnV2";
-
-const char* nextDot(const char *p) {
- while (*p && (*p != '.'))
- p++;
- return p;
-}
-
-int getHexChar (char c) {
- if ((c >= '0') && (c <= '9'))
- return c - '0';
-
- if ((c >= 'a') && (c <= 'f'))
- return 10 + (c - 'a');
-
- if ((c >= 'A') && (c <= 'F'))
- return 10 + (c - 'A');
-
- return -1;
-}
-
-bool parseFromHex(const char* start, const char* end, std::string& target)
-{
- const char *p = start;
-
- while ((p + 1) < end) {
- int nibble = getHexChar(*p++);
- if (nibble < 0)
- return false;
- int byte = (nibble << 4);
- nibble = getHexChar(*p++);
- if (nibble < 0)
- return false;
- byte += nibble;
- target.append (1, (char) byte & 0xFF);
- }
- return (p == end);
-}
-
-
-// parse string from AmqpConnection::DataSourcename
-// "QPIDdsnV2.port.host.instance_id.SSL_tf.SASL_mech.username.password"
-//
-// parse strictly and return false if the dsn is in a bad format
-
-bool parseDsn (const char *dsn, std::string& host, int& port, bool& ssl, bool& saslPlain,
- std::string& username, std::string& password) {
- if (dsn == NULL)
- return false;
-
- size_t len = strnlen(dsn, 1025);
- if (len > 1024)
- return false;
-
- if (strncmp(dsn, dsnHeader, strlen(dsnHeader)))
- return false;
-
- const char *endp = dsn + len;
- const char *tokenp = dsn + strlen(dsnHeader);
- if (*tokenp != '.')
- return false;
-
- // port
- tokenp++;
- if (tokenp >= endp)
- return false;
- if (*tokenp == '.')
- return false; // null port not allowed
-
- const char *token_end = nextDot(tokenp);
- if ((token_end - tokenp) > 5)
- return false;
-
- port = 0;
- for (const char *p = tokenp; p < token_end; p++) {
- if ((*p < '0') || (*p > '9'))
- return false;
- port = (10 * port) + (*p - '0');
- }
-
- if (port > 65535)
- return false;
-
- // host
- tokenp = token_end + 1;
- if (tokenp >= endp)
- return false;
- if (*tokenp == '.')
- return false; // null host not allowed
-
- token_end = nextDot(tokenp);
- if (!parseFromHex(tokenp, token_end, host))
- return false;
-
- // skip the RM identifier, but verify it exists
- tokenp = token_end + 1;
- if (tokenp >= endp)
- return false;
- token_end = nextDot (tokenp);
- if ((token_end - tokenp) < 3)
- return false;
-
- // ssl: look for T or F
- tokenp = token_end + 1;
- if (tokenp >= endp)
- return false;
- if (*tokenp == 'T')
- ssl = true;
- else if (*tokenp == 'F')
- ssl = false;
- else
- return false;
- if (*++tokenp != '.')
- return false;
-
- // sasl mechanism: A = anonymous, P = plain. More to come...
- ++tokenp;
- if (tokenp >= endp)
- return false;
- if (*(tokenp+1) != '.')
- return false;
-
- if (*tokenp == 'A') {
- saslPlain = false;
- tokenp += 2;
- // no auth tokens
- }
- else if (*tokenp == 'P') {
- saslPlain = true;
- tokenp += 2;
- if (tokenp >= endp)
- return false;
- token_end = nextDot (tokenp);
- if (!parseFromHex(tokenp, token_end, username))
- return false;
- tokenp = token_end + 1;
-
- if (tokenp >= endp)
- return false;
- token_end = nextDot (tokenp);
- if (!parseFromHex(tokenp, token_end, password))
- return false;
- tokenp = token_end + 1;
- }
- else
- return false;
-
- return (tokenp == endp);
-}
-
-
-
-INT ResourceManager::open() {
- INT rv = XAER_RMERR; // placeholder until we successfully connect to resource
- active = true;
- LeaveCriticalSection(&rmLock);
-
- try {
- ConnectionSettings settings;
- settings.host = this->host;
- settings.port = this->port;
-
-
- if (ssl)
- settings.protocol = "ssl";
-
- if (saslPlain) {
- settings.username = this->username;
- settings.password = this->password;
- settings.mechanism = "PLAIN";
- }
-
- qpidConnection.open(settings);
- qpidSession = qpidConnection.newSession();
- rv = XA_OK;
-/*
-TODO: logging
- } catch (const qpid::Exception& error) {
- // log it
- } catch (const std::exception& e2) {
- // log it
-*/
- } catch (...) {
- // TODO: log it
- }
-
- EnterCriticalSection(&rmLock);
- active = false;
- return rv;
-}
-
-
-INT ResourceManager::close() {
- // should never be called when already sending other commands to broker
- if (active)
- return XAER_PROTO;
-
- INT rv = XAER_RMERR; // placeholder until we successfully close resource
- active = true;
- LeaveCriticalSection(&rmLock);
- try {
- if (qpidSession.isValid()) {
- qpidSession.close();
- }
- if (qpidConnection.isOpen()) {
- qpidConnection.close();
- }
- } catch (...) {
- // TODO: log it
- }
-
- EnterCriticalSection(&rmLock);
- active = false;
-
- if (!qpidConnection.isOpen()) {
- rv = XA_OK;
- }
- return rv;
-}
-
-
-INT ResourceManager::commit(XID *xid) {
- if (active)
- return XAER_PROTO;
-
- INT rv = XAER_RMFAIL;
- active = true;
- LeaveCriticalSection(&rmLock);
-
- try {
- qpid::framing::Xid qpidXid;
- XaToQpid(*xid, qpidXid);
-
- XaResult xaResult = qpidSession.dtxCommit(qpidXid, false, true);
- if (xaResult.hasStatus()) {
- uint16_t status = xaResult.getStatus();
- switch ((XaStatus) status) {
- case XA_STATUS_XA_OK:
- case XA_STATUS_XA_RDONLY:
- case XA_STATUS_XA_HEURCOM:
- rv = XA_OK;
- break;
-
- default:
- // commit failed and a retry won't fix
- rv = XAER_RMERR;
- break;
- }
-
- }
- } catch (...) {
- // TODO: log it
- }
-
- EnterCriticalSection(&rmLock);
- active = false;
- return rv;
-}
-
-
-INT ResourceManager::rollback(XID *xid) {
- if (active)
- return XAER_PROTO;
-
- INT rv = XAER_RMFAIL;
- active = true;
- LeaveCriticalSection(&rmLock);
-
- try {
- qpid::framing::Xid qpidXid;
- XaToQpid(*xid, qpidXid);
-
- XaResult xaResult = qpidSession.dtxRollback(qpidXid, true);
- if (xaResult.hasStatus()) {
- uint16_t status = xaResult.getStatus();
- switch ((XaStatus) status) {
- case XA_STATUS_XA_OK:
- case XA_STATUS_XA_HEURRB:
- rv = XA_OK;
- break;
-
- default:
- // RM internal error
- rv = XA_RBPROTO;
- break;
- }
- }
- } catch (...) {
- // TODO: log it
- }
-
- EnterCriticalSection(&rmLock);
- active = false;
- return rv;
-}
-
-
-INT ResourceManager::recover(XID *xids, long count, long flags) {
- if (active)
- return XAER_PROTO;
-
- if ((xids == NULL) && (count != 0))
- return XAER_INVAL;
-
- if (count < 0)
- return XAER_INVAL;
-
- if (!(flags & TMSTARTRSCAN) && (cursor == -1))
- // no existing scan and no scan requested
- return XAER_INVAL;
-
- INT status = XA_OK;
-
- if (flags & TMSTARTRSCAN) {
- // start a fresh scan
- cursor = -1;
- inDoubtXids.clear();
- active = true;
- LeaveCriticalSection(&rmLock);
-
- try {
- // status if we can't talk to the broker
- status = XAER_RMFAIL;
-
- DtxRecoverResult dtxrr = qpidSession.dtxRecover(true);
-
- // status if we can't process the xids
- status = XAER_RMERR;
-
- std::vector<std::string> wireFormatXids(dtxrr.getInDoubt().size());
- std::transform(dtxrr.getInDoubt().begin(), dtxrr.getInDoubt().end(), wireFormatXids.begin(), Array::get<std::string, Array::ValuePtr>);
-
- size_t nXids = wireFormatXids.size();
-
- if (nXids > 0) {
- StructHelper decoder;
- Xid qpidXid;
- for (size_t i = 0; i < nXids; i++) {
- decoder.decode (qpidXid, wireFormatXids[i]);
- inDoubtXids.push_back(qpidXid);
- }
-
- // if we got here the decoder validated the Xids
- status = XA_OK;
-
- // make sure none are too big, just in case
-
- for (size_t i = 0; i < nXids; i++) {
- Xid& xid = inDoubtXids[i];
- size_t l1 = xid.hasGlobalId() ? xid.getGlobalId().size() : 0;
- size_t l2 = xid.hasBranchId() ? xid.getBranchId().size() : 0;
- if ((l1 > MAXGTRIDSIZE) || (l2 > MAXBQUALSIZE) ||
- ((l1 + l2) > XIDDATASIZE)) {
- status = XAER_RMERR;
- break;
- }
- }
- }
- else {
- // nXids == 0, the previously cleared inDoubtXids is correctly populated
- status = XA_OK;
- }
-
- if (status == XA_OK)
- cursor = 0;
- } catch (...) {
- // TODO: log it
- }
-
- EnterCriticalSection(&rmLock);
- active = false;
- }
- else {
- // TMSTARTRSCAN not set, is there an existing scan to work from?
- if (cursor == -1)
- return XAER_INVAL;
- }
-
- if (status != XA_OK)
- return status;
-
- INT actualCount = count;
- if (count > 0) {
- int nAvailable = (int) inDoubtXids.size() - cursor;
- if (nAvailable < count)
- actualCount = nAvailable;
-
- for (int i = 0; i < actualCount; i++) {
- Xid& qpidXid = inDoubtXids[i + cursor];
- QpidToXa(qpidXid, xids[i]);
- }
- }
-
- if (flags & TMENDRSCAN) {
- cursor = -1;
- inDoubtXids.clear();
- }
-
- return actualCount;
-}
-
-
-// Call with lock held
-
-ResourceManager* findRm(int rmid) {
- if (rmMap.find(rmid) == rmMap.end()) {
- return NULL;
- }
- return rmMap[rmid];
-}
-
-
-INT __cdecl xa_open (char *xa_info, int rmid, long flags) {
- if (flags & TMASYNC)
- return XAER_ASYNC;
-
- INT rv = XAER_RMERR;
- EnterCriticalSection(&rmLock);
-
- ResourceManager* rmp = findRm(rmid);
- if (rmp != NULL) {
- // error: already in use
- rv = XAER_PROTO;
- }
- else {
- std::string brokerHost;
- int brokerPort;
- std::string username;
- std::string password;
- bool ssl;
- bool saslPlain;
-
- if (parseDsn(xa_info, brokerHost, brokerPort, ssl, saslPlain, username, password)) {
-
- try {
- rmp = new ResourceManager(rmid, brokerHost, brokerPort, ssl, saslPlain, username, password);
-
- rv = rmp->open();
- if (rv != XA_OK) {
- delete (rmp);
- }
- else {
- rmMap[rmid] = rmp;
- }
- } catch (...) {}
- }
- else {
- rv = XAER_INVAL;
- }
- }
-
- LeaveCriticalSection(&rmLock);
- return rv;
-}
-
-
-INT __cdecl xa_close (char *xa_info, int rmid, long flags) {
- if (flags & TMASYNC)
- return XAER_ASYNC;
-
- INT rv = XAER_RMERR;
-
- EnterCriticalSection(&rmLock);
- ResourceManager* rmp = findRm(rmid);
-
- if (rmp == NULL) {
- // can close multiple times
- rv = XA_OK;
- }
- else {
- rv = rmp->close();
- rmMap.erase(rmid);
- try {
- delete (rmp);
- } catch (...) {
- // TODO: log it
- }
- }
-
- LeaveCriticalSection(&rmLock);
- return rv;
-}
-
-
-INT __cdecl xa_commit (XID *xid, int rmid, long flags) {
- if (flags & TMASYNC)
- return XAER_ASYNC;
-
- INT rv = XAER_RMFAIL;
-
- EnterCriticalSection(&rmLock);
- ResourceManager* rmp = findRm(rmid);
-
- if (rmp == NULL) {
- rv = XAER_INVAL;
- }
- else {
- rv = rmp->commit(xid);
- }
-
- LeaveCriticalSection(&rmLock);
- return rv;
-}
-
-
-INT __cdecl xa_rollback (XID *xid, int rmid, long flags) {
- if (flags & TMASYNC)
- return XAER_ASYNC;
-
- INT rv = XAER_RMFAIL;
-
- EnterCriticalSection(&rmLock);
- ResourceManager* rmp = findRm(rmid);
-
- if (rmp == NULL) {
- rv = XAER_INVAL;
- }
- else {
- rv = rmp->rollback(xid);
- }
-
- LeaveCriticalSection(&rmLock);
- return rv;
-}
-
-
-INT __cdecl xa_recover (XID *xids, long count, int rmid, long flags) {
- INT rv = XAER_RMFAIL;
-
- EnterCriticalSection(&rmLock);
- ResourceManager* rmp = findRm(rmid);
-
- if (rmp == NULL) {
- rv = XAER_PROTO;
- }
- else {
- rv = rmp->recover(xids, count, flags);
- }
-
- LeaveCriticalSection(&rmLock);
- return rv;
-}
-
-
-INT __cdecl xa_start (XID *xid, int rmid, long flags) {
- // not used in recovery
- return XAER_PROTO;
-}
-
-
-INT __cdecl xa_end (XID *xid, int rmid, long flags) {
- // not used in recovery
- return XAER_PROTO;
-}
-
-
-INT __cdecl xa_prepare (XID *xid, int rmid, long flags) {
- // not used in recovery
- return XAER_PROTO;
-}
-
-
-INT __cdecl xa_forget (XID *xid, int rmid, long flags) {
- // not used in recovery
- return XAER_PROTO;
-}
-
-
-INT __cdecl xa_complete (int *handle, int *retval, int rmid, long flags) {
- // not used in recovery
- return XAER_PROTO;
-}
-
-
-
-xa_switch_t xaSwitch;
-
-HRESULT __cdecl GetQpidXaSwitch (DWORD XaSwitchFlags, xa_switch_t ** ppXaSwitch)
-{
- // needed for now due to implicit use of FreeLibrary in WSACleanup() in qpid/cpp/src/qpid/sys/windows/Socket.cpp
- pinDll();
-
- if (xaSwitch.xa_open_entry != xa_open) {
-
- xaSwitch.xa_open_entry = xa_open;
- xaSwitch.xa_close_entry = xa_close;
- xaSwitch.xa_start_entry = xa_start;
- xaSwitch.xa_end_entry = xa_end;
- xaSwitch.xa_prepare_entry = xa_prepare;
- xaSwitch.xa_commit_entry = xa_commit;
- xaSwitch.xa_rollback_entry = xa_rollback;
- xaSwitch.xa_recover_entry = xa_recover;
- xaSwitch.xa_forget_entry = xa_forget;
- xaSwitch.xa_complete_entry = xa_complete;
-
- strcpy_s(xaSwitch.name, RMNAMESZ, "qpidxarm");
- xaSwitch.flags = TMNOMIGRATE;
- xaSwitch.version = 0;
- }
- *ppXaSwitch = &xaSwitch;
- return S_OK;
-}
-
-
-
-
-}}} // namespace Apache::Qpid::DtcPlugin
-
-
-// GetXaSwitch
-
-extern "C" {
-
- __declspec(dllexport) HRESULT __cdecl GetXaSwitch (DWORD XaSwitchFlags, xa_switch_t ** ppXaSwitch)
- {
- return Apache::Qpid::DtcPlugin::GetQpidXaSwitch (XaSwitchFlags, ppXaSwitch);
- }
-}
-
-
-// dllmain
-
-BOOL APIENTRY DllMain( HMODULE hModule,
- DWORD ul_reason_for_call,
- LPVOID lpReserved)
-{
-
- switch (ul_reason_for_call)
- {
- case DLL_PROCESS_ATTACH:
- InitializeCriticalSection(&Apache::Qpid::DtcPlugin::rmLock);
- Apache::Qpid::DtcPlugin::thisDll = hModule;
- break;
-
- case DLL_PROCESS_DETACH:
- DeleteCriticalSection(&Apache::Qpid::DtcPlugin::rmLock);
- break;
-
- case DLL_THREAD_ATTACH:
- case DLL_THREAD_DETACH:
- break;
- }
- return TRUE;
-}
-
diff --git a/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.cpp b/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.cpp deleted file mode 100644 index 1bc9a15d92..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.cpp +++ /dev/null @@ -1,276 +0,0 @@ -/* -* 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. -*/ - -#include <windows.h> -#include <msclr\lock.h> -#include <oletx2xa.h> - -#include "qpid/client/AsyncSession.h" -#include "qpid/client/SubscriptionManager.h" -#include "qpid/client/Connection.h" -#include "qpid/client/Message.h" -#include "qpid/client/MessageListener.h" -#include "qpid/framing/FrameSet.h" - -#include "AmqpConnection.h" -#include "AmqpSession.h" -#include "QpidMarshal.h" -#include "QpidException.h" -#include "DtxResourceManager.h" -#include "XaTransaction.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Runtime::InteropServices; -using namespace msclr; - -using namespace qpid::client; -using namespace std; - - -// Note on locks: Use thisLock for fast counting and idle/busy -// notifications. Use the "sessions" list to serialize session -// creation/reaping and overall tear down. - - -AmqpConnection::AmqpConnection(String^ server, int port) : - connectionp(NULL), - busyCount(0), - disposed(false) -{ - initialize (server, port, false, false, nullptr, nullptr); -} - -AmqpConnection::AmqpConnection(System::String^ server, int port, bool ssl, bool saslPlain, System::String^ username, System::String^ password) : - connectionp(NULL), - busyCount(0), - disposed(false) -{ - initialize (server, port, ssl, saslPlain, username, password); -} - -void AmqpConnection::initialize(System::String^ server, int port, bool ssl, bool saslPlain, System::String^ username, System::String^ password) -{ - if (server == nullptr) - throw gcnew ArgumentNullException("AMQP server"); - if (saslPlain) { - if (username == nullptr) - throw gcnew ArgumentNullException("username"); - if (username == nullptr) - throw gcnew ArgumentNullException("password"); - } - - bool success = false; - System::Exception^ openException = nullptr; - sessions = gcnew Collections::Generic::List<AmqpSession^>(); - thisLock = gcnew Object(); - - try { - connectionp = new Connection; - - if (ssl || saslPlain) { - ConnectionSettings proposedSettings; - proposedSettings.host = QpidMarshal::ToNative(server); - proposedSettings.port = port; - if (ssl) - proposedSettings.protocol = "ssl"; - - if (saslPlain) { - proposedSettings.username = QpidMarshal::ToNative(username); - proposedSettings.password = QpidMarshal::ToNative(password); - proposedSettings.mechanism = "PLAIN"; - } - - connectionp->open (proposedSettings); - } - else { - connectionp->open (QpidMarshal::ToNative(server), port); - } - - // TODO: registerFailureCallback for failover - success = true; - const ConnectionSettings& settings = connectionp->getNegotiatedSettings(); - this->maxFrameSize = settings.maxFrameSize; - this->host = server; - this->port = port; - this->ssl = ssl; - this->saslPlain = saslPlain; - this->username = username; - this->password = password; - this->isOpen = true; - } catch (const qpid::Exception& error) { - String^ errmsg = gcnew String(error.what()); - openException = gcnew QpidException(errmsg); - } finally { - if (!success) { - Cleanup(); - if (openException == nullptr) { - openException = gcnew QpidException ("unknown connection failure"); - } - throw openException; - } - } -} - -AmqpConnection^ AmqpConnection::Clone() { - if (disposed) - throw gcnew ObjectDisposedException("AmqpConnection.Clone"); - return gcnew AmqpConnection (this->host, this->port, this->ssl, this->saslPlain, this->username, this->password); -} - -void AmqpConnection::Cleanup() -{ - { - lock l(sessions); - if (disposed) - return; - disposed = true; - } - - try { - // let the child sessions clean up - - for each(AmqpSession^ s in sessions) { - s->ConnectionClosed(); - } - } - finally - { - if (connectionp != NULL) { - isOpen = false; - connectionp->close(); - delete connectionp; - connectionp = NULL; - } - } -} - -AmqpConnection::~AmqpConnection() -{ - Cleanup(); -} - -AmqpConnection::!AmqpConnection() -{ - Cleanup(); -} - -void AmqpConnection::Close() -{ - // Simulate Dispose()... - Cleanup(); - GC::SuppressFinalize(this); -} - -AmqpSession^ AmqpConnection::CreateSession() -{ - lock l(sessions); - if (disposed) { - throw gcnew ObjectDisposedException("AmqpConnection"); - } - AmqpSession^ session = gcnew AmqpSession(this, connectionp); - sessions->Add(session); - return session; -} - -// called whenever a child session becomes newly busy (a first reader or writer since last idle) - -void AmqpConnection::NotifyBusy() -{ - bool changed = false; - { - lock l(thisLock); - if (busyCount++ == 0) - changed = true; - } -} - -// called whenever a child session becomes newly idle (a last reader or writer has closed) -// The connection is idle when none of its child sessions are busy - -void AmqpConnection::NotifyIdle() -{ - bool connectionIdle = false; - { - lock l(thisLock); - if (--busyCount == 0) - connectionIdle = true; - } - if (connectionIdle) { - OnConnectionIdle(this, System::EventArgs::Empty); - } -} - -void HexAppend(StringBuilder^ sb, String^ s) { - if (s->Length > 0) { - array<unsigned char>^ bytes = Encoding::UTF8->GetBytes(s); - for each (unsigned char b in bytes) { - sb->Append(String::Format("{0:x2}", b)); - } - } - sb->Append("."); -} - - -// Note: any change to this format has to be reflected in the DTC plugin's xa_open() -// for now: "QPIDdsnV2.port.host.instance_id.SSL_tf.SASL_mech.username.password" -// This extended info is needed so that the DTC can make a separate connection to the broker -// for recovery. - -String^ AmqpConnection::DataSourceName::get() { - if (dataSourceName == nullptr) { - StringBuilder^ sb = gcnew StringBuilder(); - sb->Append("QPIDdsnV2."); - - sb->Append(this->port); - sb->Append("."); - - HexAppend(sb, this->host); - - sb->Append(System::Diagnostics::Process::GetCurrentProcess()->Id); - sb->Append("-"); - sb->Append(AppDomain::CurrentDomain->Id); - sb->Append("."); - - if (this->ssl) - sb->Append("T"); - else - sb->Append("F"); - sb->Append("."); - - if (this->saslPlain) { - sb->Append("P."); - HexAppend(sb, this->username); - HexAppend(sb, this->password); - } - else { - // SASL anonymous - sb->Append("A."); - } - - dataSourceName = sb->ToString(); - } - return dataSourceName; -} - - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.h b/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.h deleted file mode 100644 index ef4d0e3f37..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/AmqpConnection.h +++ /dev/null @@ -1,97 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace std; -using namespace qpid::client; - -ref class AmqpSession; -ref class DtxResourceManager; - -public delegate void ConnectionIdleEventHandler(Object^ sender, EventArgs^ eventArgs); - -public ref class AmqpConnection -{ -private: - Connection* connectionp; - bool disposed; - Collections::Generic::List<AmqpSession^>^ sessions; - bool isOpen; - int busyCount; - int maxFrameSize; - DtxResourceManager^ dtxResourceManager; - // unique string used for distributed transactions - String^ dataSourceName; - Object ^thisLock; - - // properties needed to allow DTC to do transactions (see DataSourceName - String^ host; - int port; - bool ssl; - bool saslPlain; - String^ username; - String^ password; - - void Cleanup(); - void initialize (System::String^ server, int port, bool ssl, bool saslPlain, System::String^ username, System::String^ password); - - internal: - void NotifyBusy(); - void NotifyIdle(); - AmqpConnection^ Clone(); - - property int MaxFrameSize { - int get () { return maxFrameSize; } - } - - property DtxResourceManager^ CachedResourceManager { - DtxResourceManager^ get () { return dtxResourceManager; } - void set (DtxResourceManager^ value) { dtxResourceManager = value; } - } - - property String^ DataSourceName { - String^ get(); - } - -public: - AmqpConnection(System::String^ server, int port); - AmqpConnection(System::String^ server, int port, bool ssl, bool saslPlain, System::String^ username, System::String^ password); - ~AmqpConnection(); - !AmqpConnection(); - void Close(); - AmqpSession^ CreateSession(); - event ConnectionIdleEventHandler^ OnConnectionIdle; - - property bool IsOpen { - bool get() { return isOpen; } - }; - - property bool IsIdle { - bool get() { return (busyCount == 0); } - } -}; - - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/AmqpMessage.cpp b/qpid/wcf/src/Apache/Qpid/Interop/AmqpMessage.cpp deleted file mode 100644 index 5c333aff60..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/AmqpMessage.cpp +++ /dev/null @@ -1,76 +0,0 @@ -/* -* 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. -*/ - -#include <windows.h> -#include <msclr\lock.h> - -#include "qpid/client/AsyncSession.h" -#include "qpid/framing/FrameSet.h" -#include "qpid/framing/AMQFrame.h" - -#include "MessageBodyStream.h" -#include "AmqpMessage.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Threading; -using namespace msclr; - -using namespace Apache::Qpid::AmqpTypes; - -AmqpMessage::AmqpMessage(MessageBodyStream ^mbs) : - messageBodyStream(mbs), - disposed(false) -{ -} - -void AmqpMessage::Cleanup() -{ - { - lock l(this); - if (disposed) - return; - - disposed = true; - } - - messageBodyStream->Close(); -} - -AmqpMessage::~AmqpMessage() -{ - Cleanup(); -} - -AmqpMessage::!AmqpMessage() -{ - Cleanup(); -} - -void AmqpMessage::Close() -{ - // Simulate Dispose()... - Cleanup(); - GC::SuppressFinalize(this); -} - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/AmqpMessage.h b/qpid/wcf/src/Apache/Qpid/Interop/AmqpMessage.h deleted file mode 100644 index f0801d30dc..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/AmqpMessage.h +++ /dev/null @@ -1,61 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Runtime::InteropServices; - -using namespace qpid::client; -using namespace std; - - - -public ref class AmqpMessage -{ -private: - MessageBodyStream^ messageBodyStream; - AmqpTypes::AmqpProperties^ amqpProperties; - bool disposed; - void Cleanup(); - -internal: - AmqpMessage(MessageBodyStream ^bstream); - -public: - ~AmqpMessage(); - !AmqpMessage(); - void Close(); - - property AmqpTypes::AmqpProperties^ Properties { - AmqpTypes::AmqpProperties^ get () { return amqpProperties; } - void set(AmqpTypes::AmqpProperties^ p) { amqpProperties = p; } - } - - property System::IO::Stream^ BodyStream { - System::IO::Stream^ get() { return messageBodyStream; } - } -}; - - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp b/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp deleted file mode 100644 index ac7c777d1f..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.cpp +++ /dev/null @@ -1,633 +0,0 @@ -/* -* 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. -*/ - -#include <windows.h> -#include <msclr\lock.h> -#include <oletx2xa.h> - -#include "qpid/client/AsyncSession.h" -#include "qpid/client/SubscriptionManager.h" -#include "qpid/client/Connection.h" -#include "qpid/client/SessionImpl.h" -#include "qpid/client/SessionBase_0_10Access.h" -#include "qpid/client/Message.h" -#include "qpid/framing/MessageTransferBody.h" -#include "qpid/client/Future.h" -#include "qpid/framing/Xid.h" - -#include "AmqpConnection.h" -#include "AmqpSession.h" -#include "AmqpMessage.h" -#include "MessageBodyStream.h" -#include "InputLink.h" -#include "OutputLink.h" -#include "QpidMarshal.h" -#include "QpidException.h" -#include "XaTransaction.h" -#include "DtxResourceManager.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Runtime::InteropServices; -using namespace System::Transactions; -using namespace msclr; - -using namespace qpid::client; -using namespace std; - - -AmqpSession::AmqpSession(AmqpConnection^ conn, qpid::client::Connection* qpidConnectionp) : - connection(conn), - sessionp(NULL), - sessionImplp(NULL), - subs_mgrp(NULL), - helperRunning(false), - openCount(0), - syncCount(0), - closing(false), - dtxEnabled(false) -{ - bool success = false; - try { - sessionp = new qpid::client::AsyncSession; - *sessionp = qpidConnectionp->newSession(); - subs_mgrp = new SubscriptionManager (*sessionp); - waiters = gcnew Collections::Generic::List<CompletionWaiter^>(); - sessionLock = waiters; // waiters convenient and not publicly visible - openCloseLock = gcnew Object(); - success = true; - } finally { - if (!success) { - Cleanup(); - // TODO: include inner exception information - throw gcnew QpidException ("session creation failure"); - } - } -} - - -void AmqpSession::Cleanup() -{ - bool connected = connection->IsOpen; - - if (subs_mgrp != NULL) { - if (connected) - subs_mgrp->stop(); - delete subs_mgrp; - subs_mgrp = NULL; - } - - if (sessionp != NULL) { - if (connected) { - sessionp->close(); - } - delete sessionp; - sessionp = NULL; - sessionImplp = NULL; - } -} - - -static qpid::framing::Xid& getXid(XaTransaction^ xaTx) -{ - return *((qpid::framing::Xid *)xaTx->XidHandle.ToPointer()); -} - - -void AmqpSession::CheckOpen() -{ - if (closing) - throw gcnew ObjectDisposedException("AmqpSession"); -} - - -// Called by the parent AmqpConnection - -void AmqpSession::ConnectionClosed() -{ - lock l(sessionLock); - - if (closing) - return; - - closing = true; - - if (connection->IsOpen) { - // send closing handshakes... - - if (dtxEnabled) { - // session may close before all its transactions complete, at least force the phase 0 flush - if (pendingTransactions->Count > 0) { - array<XaTransaction^>^ txArray = pendingTransactions->ToArray(); - l.release(); - for each (XaTransaction^ xaTx in txArray) { - //xaTx->SessionClosing(this); - xaTx->WaitForCompletion(); - } - l.acquire(); - } - } - - WaitLastSync (%l); - // Assert pendingTransactions->Count == 0 - - if (openXaTransaction != nullptr) { - // send final dtxend - sessionp->dtxEnd(getXid(openXaTransaction), false, true, false); - openXaTransaction = nullptr; - openSystemTransaction = nullptr; - // this operation will complete by the time Cleanup() returns - } - } - - Cleanup(); -} - -InputLink^ AmqpSession::CreateInputLink(System::String^ sourceQueue) -{ - return CreateInputLink(sourceQueue, true, false, nullptr, nullptr); -} - -InputLink^ AmqpSession::CreateInputLink(System::String^ sourceQueue, bool exclusive, bool temporary, - System::String^ filterKey, System::String^ exchange) -{ - lock ocl(openCloseLock); - lock l(sessionLock); - CheckOpen(); - - InputLink^ link = gcnew InputLink (this, sourceQueue, sessionp, subs_mgrp, exclusive, temporary, filterKey, exchange); - { - if (openCount == 0) { - l.release(); - connection->NotifyBusy(); - } - openCount++; - } - return link; -} - -OutputLink^ AmqpSession::CreateOutputLink(System::String^ targetQueue) -{ - lock ocl(openCloseLock); - lock l(sessionLock); - CheckOpen(); - - OutputLink^ link = gcnew OutputLink (this, targetQueue); - - if (sessionImplp == NULL) { - // not needed unless sending messages - SessionBase_0_10Access sa(*sessionp); - boost::shared_ptr<SessionImpl> sip = sa.get(); - sessionImplp = sip.get(); - } - - if (openCount == 0) { - l.release(); - connection->NotifyBusy(); - } - openCount++; - - return link; -} - - -// called whenever a child InputLink or OutputLink is closed or finalized -void AmqpSession::NotifyClosed() -{ - lock ocl(openCloseLock); - openCount--; - if (openCount == 0) { - connection->NotifyIdle(); - } -} - - -CompletionWaiter^ AmqpSession::SendMessage (System::String^ queue, MessageBodyStream ^mbody, TimeSpan timeout, bool async, AsyncCallback^ callback, Object^ state) -{ - lock l(sessionLock); - - // delimit with session dtx commands depending on the transaction context - UpdateTransactionState(%l); - - CheckOpen(); - - bool syncPending = false; - - // create an AMQP message.transfer command to use with the partial frameset from the MessageBodyStream - - std::string exname = QpidMarshal::ToNative(queue); - FrameSet *framesetp = (FrameSet *) mbody->GetFrameSet().ToPointer(); - uint8_t acceptMode=1; - uint8_t acquireMode=0; - MessageTransferBody mtcmd(ProtocolVersion(0,10), exname, acceptMode, acquireMode); - // ask for a command completion - mtcmd.setSync(true); - - //send it - - Future *futurep = NULL; - try { - futurep = new Future(sessionImplp->send(mtcmd, *framesetp)); - - CompletionWaiter^ waiter = nullptr; - if (async || (timeout != TimeSpan::MaxValue)) { - waiter = gcnew CompletionWaiter(this, timeout, (IntPtr) futurep, callback, state); - // waiter is responsible for releasing the Future native resource - futurep = NULL; - addWaiter(waiter); - return waiter; - } - - // synchronous send with no timeout: no need to involve the asyncHelper thread - - IncrementSyncs(); - syncPending = true; - l.release(); - internalWaitForCompletion((IntPtr) futurep); - } - finally { - if (syncPending) { - if (!l.is_locked()) - l.acquire(); - DecrementSyncs(); - } - if (futurep != NULL) - delete (futurep); - } - return nullptr; -} - - -void AmqpSession::Bind(System::String^ queue, System::String^ exchange, System::String^ filterKey) -{ - lock l(sessionLock); - CheckOpen(); - - sessionp->exchangeBind(arg::queue=QpidMarshal::ToNative(queue), - arg::exchange=QpidMarshal::ToNative(exchange), - arg::bindingKey=QpidMarshal::ToNative(filterKey)); - -} - - -void AmqpSession::internalWaitForCompletion(IntPtr fp) -{ - Debug::Assert(syncCount > 0, "sync counter mismatch"); - - // Qpid native lib call to wait for the command completion - ((Future *)fp.ToPointer())->wait(*sessionImplp); -} - -// call with lock held -void AmqpSession::addWaiter(CompletionWaiter^ waiter) -{ - IncrementSyncs(); - waiters->Add(waiter); - if (!helperRunning) { - helperRunning = true; - ThreadPool::QueueUserWorkItem(gcnew WaitCallback(this, &AmqpSession::asyncHelper)); - } -} - - -void AmqpSession::removeWaiter(CompletionWaiter^ waiter) -{ - // a waiter can be removed from anywhere in the list if timed out - - lock l(sessionLock); - int idx = waiters->IndexOf(waiter); - if (idx == -1) { - // TODO: assert or log - } - else { - waiters->RemoveAt(idx); - DecrementSyncs(); - } -} - - -// process CompletionWaiter list one at a time. - -void AmqpSession::asyncHelper(Object ^unused) -{ - lock l(sessionLock); - - while (true) { - if (waiters->Count == 0) { - helperRunning = false; - return; - } - - CompletionWaiter^ waiter = waiters[0]; - l.release(); - // can block, but for short time - // the waiter removes itself from the list, possibly as the timer thread on timeout - waiter->Run(); - l.acquire(); - } -} - -bool AmqpSession::MessageStop(std::string &name) -{ - lock l(sessionLock); - - if (closing) - return false; - - sessionp->messageStop(name, true); - return true; -} - -void AmqpSession::AcceptAndComplete(SequenceSet& transfers, bool browsing) -{ - lock l(sessionLock); - - if (!browsing) { - // delimit with session dtx commands depending on the transaction context - UpdateTransactionState(%l); - } - - CheckOpen(); - - sessionp->markCompleted(transfers, false); - if (!browsing) - sessionp->messageAccept(transfers, false); -} - - -// call with session lock held - -void AmqpSession::UpdateTransactionState(lock^ slock) -{ - Transaction^ currentTx = Transaction::Current; - if ((currentTx == nullptr) && !dtxEnabled) { - // no transaction scope and no previous dtx work to monitor - return; - } - - if (currentTx == openSystemTransaction) { - // no change - return; - } - - if (!dtxEnabled) { - // AMQP requires that this be the first dtx-related command on the session - sessionp->dtxSelect(false); - dtxEnabled = true; - pendingTransactions = gcnew Collections::Generic::List<XaTransaction^>(); - } - - bool notify = false; // unless the System.Transaction is no longer active - XaTransaction^ oldXaTx = openXaTransaction; - if (openSystemTransaction != nullptr) { - // The application may start a new transaction before the phase0 on rollback - try { - if (openSystemTransaction->TransactionInformation->Status != TransactionStatus::Active) { - notify = true; - } - } catch (System::ObjectDisposedException^) { - notify = true; - } - } - - slock->release(); - // only use stack variables until lock re-acquired - - if (notify) { - // will do call back to all enlisted sessions. call with session lock released. - // If NotifyPhase0() wins the race to start phase 0, openXaTransaction will be null - oldXaTx->NotifyPhase0(); - } - - XaTransaction^ newXaTx = nullptr; - if (currentTx != nullptr) { - // This must be called with locks released. The DTC and System.Transactions methods that - // will be called hold locks that interfere with the ITransactionResourceAsync callbacks. - newXaTx = DtxResourceManager::GetXaTransaction(this, currentTx); - } - - slock->acquire(); - - if (closing) - return; - - if (openSystemTransaction != nullptr) { - // some other transaction has the dtx window open - // close the XID window, suspend = true... in case it is used again - sessionp->dtxEnd(getXid(openXaTransaction), false, true, false); - openSystemTransaction = nullptr; - openXaTransaction = nullptr; - } - - - // Call enlist with session lock held. The XaTransaction will call DtxStart before returning. - if (newXaTx != nullptr) { - if (!pendingTransactions->Contains(newXaTx)) { - pendingTransactions->Add(newXaTx); - } - - newXaTx->Enlist(this); - } - - openXaTransaction = newXaTx; - openSystemTransaction = currentTx; -} - - -typedef TypedResult<qpid::framing::XaResult> XaResultCompletion; - - -// send the required closing dtx.End before Phase 1 - -IntPtr AmqpSession::BeginPhase0Flush(XaTransaction ^xaTx) { - - lock l(sessionLock); - IntPtr completionp = IntPtr::Zero; - try { - if (sessionp != NULL) { - - // proceed even if "closing == true", the phase 0 is part of the transition from closing to closed - - if (xaTx != openXaTransaction) { - // a different transaction (or none) is in scope, so xaTx was previously suspended. - // must re-open it to close it properly - if (openXaTransaction != nullptr) { - // suspend the session's current pending transaction - // it wil be reopened in a future enlistment or phase 0 flush. - sessionp->dtxEnd(getXid(openXaTransaction), false, true, false); - } - // resuming - sessionp->dtxStart(getXid(xaTx), false, true, false); - } - - // the closing (i.e. non-suspended) dtxEnd happens here (exactly once for a given transaction) - // set the sync bit since phase0 is a precondition to prepare or abort - completionp = (IntPtr) new XaResultCompletion(sessionp->dtxEnd(getXid(xaTx), false, false, true)); - IncrementSyncs(); - } - } - catch (System::Exception^ ) { - // all the caller wants to know is if completionp is non-null - } - - openXaTransaction = nullptr; - openSystemTransaction = nullptr; - return completionp; -} - - -void AmqpSession::EndPhase0Flush(XaTransaction ^xaTx, IntPtr intptr) { - XaResultCompletion *completionp = (XaResultCompletion *) intptr.ToPointer(); - lock l(sessionLock); - - if (completionp != NULL) { - try { - l.release(); - completionp->wait(); - pendingTransactions->Remove(xaTx); - } - catch (System::Exception^) { - // connection closed or network drop - } - finally { - l.acquire(); - DecrementSyncs(); - delete completionp; - } - } -} - - -IntPtr AmqpSession::DtxStart(IntPtr ip, bool join, bool resume) { - // called with session lock held (as a callback from the Enlist()) - // The XaTransaction knows if this should be the originating dtxStart, or a join/resume - IntPtr rv = IntPtr::Zero; - qpid::framing::Xid* xidp = (qpid::framing::Xid *) ip.ToPointer(); - if (join || resume) { - sessionp->dtxStart(*xidp, join, resume, false); - } - else { - // The XaTransaction needs to track when the first dtxStart completes to safely request a join - IncrementSyncs(); // caller must use ReleaseCompletion() for corresponding DecrementSyncs - rv = (IntPtr) new XaResultCompletion(sessionp->dtxStart(*xidp, join, resume, false)); - } - - return rv; -} - - -IntPtr AmqpSession::DtxPrepare(IntPtr ip) { - qpid::framing::Xid* xidp = (qpid::framing::Xid *) ip.ToPointer(); - lock l(sessionLock); - - if (closing) - return IntPtr::Zero; - - IncrementSyncs(); // caller must use ReleaseCompletion() for corresponding DecrementSyncs - return (IntPtr) new XaResultCompletion(sessionp->dtxPrepare(*xidp, true)); -} - - -IntPtr AmqpSession::DtxCommit(IntPtr ip, bool onePhase) { - qpid::framing::Xid* xidp = (qpid::framing::Xid *) ip.ToPointer(); - lock l(sessionLock); - - if (closing) - return IntPtr::Zero; - - IncrementSyncs(); // caller must use ReleaseCompletion() for corresponding DecrementSyncs - return (IntPtr) new XaResultCompletion(sessionp->dtxCommit(*xidp, onePhase, true)); -} - - -IntPtr AmqpSession::DtxRollback(IntPtr ip) { - qpid::framing::Xid* xidp = (qpid::framing::Xid *) ip.ToPointer(); - lock l(sessionLock); - if (closing) - return IntPtr::Zero; - - IncrementSyncs(); // caller must use ReleaseCompletion() for corresponding DecrementSyncs - - return (IntPtr) new XaResultCompletion(sessionp->dtxRollback(*xidp, true)); -} - - -//call with lock held -void AmqpSession::IncrementSyncs() { - syncCount++; -} - - -//call with lock held -void AmqpSession::DecrementSyncs() { - syncCount--; - Debug::Assert(syncCount >= 0, "sync counter underrun"); - if (syncCount == 0) { - if (closeWaitHandle != nullptr) { - // now OK to move from closing to closed - closeWaitHandle->Set(); - } - } -} - - -// call with lock held -void AmqpSession::WaitLastSync(lock ^l) { - if (syncCount == 0) - return; - if (AppDomain::CurrentDomain->IsFinalizingForUnload()) { - // a wait would be a hang. No more syncs coming - return; - } - if (closeWaitHandle == nullptr) - closeWaitHandle = gcnew ManualResetEvent(false); - l->release(); - closeWaitHandle->WaitOne(); - l->acquire(); -} - - -void AmqpSession::ReleaseCompletion(IntPtr completion) { - lock l(sessionLock); - DecrementSyncs(); - delete completion.ToPointer(); -} - - -// Non-exclusive borrowing for a "brief" period. I.e. several synced -// commands (address resolution) - -IntPtr AmqpSession::BorrowNativeSession() { - lock l(sessionLock); - if (closing) - return IntPtr::Zero; - - IncrementSyncs(); - return (IntPtr) sessionp; -} - -void AmqpSession::ReturnNativeSession() { - lock l(sessionLock); - DecrementSyncs(); -} - -}}} // namespace Apache::Qpid::Cli diff --git a/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.h b/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.h deleted file mode 100644 index 7a49496805..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/AmqpSession.h +++ /dev/null @@ -1,109 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -#include "AmqpConnection.h" -#include "MessageBodyStream.h" -#include "CompletionWaiter.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Runtime::InteropServices; -using namespace System::Transactions; -using namespace System::Diagnostics; - - -using namespace qpid::client; -using namespace std; - -ref class InputLink; -ref class OutputLink; -ref class XaTransaction; - -public ref class AmqpSession -{ -private: - Object^ sessionLock; - Object^ openCloseLock; - AmqpConnection^ connection; - AsyncSession* sessionp; - SessionImpl* sessionImplp; - SubscriptionManager* subs_mgrp; - Collections::Generic::List<CompletionWaiter^>^ waiters; - bool helperRunning; - - // number of active InputLinks and OutputLinks - int openCount; - - // the number of async commands sent to the broker that need completion confirmation - int syncCount; - - bool closing; - ManualResetEvent^ closeWaitHandle; - bool dtxEnabled; - Transaction^ openSystemTransaction; - XaTransaction^ openXaTransaction; - Collections::Generic::List<XaTransaction^>^ pendingTransactions; - - void Cleanup(); - void CheckOpen(); - void asyncHelper(Object ^); - void addWaiter(CompletionWaiter^ waiter); - void UpdateTransactionState(msclr::lock^ sessionLock); - void IncrementSyncs(); - void DecrementSyncs(); - void WaitLastSync(msclr::lock^ l); - -public: - OutputLink^ CreateOutputLink(System::String^ targetQueue); - InputLink^ CreateInputLink(System::String^ sourceQueue); - - // 0-10 specific support; deprecated in favor of Qpid messaging addresses - InputLink^ CreateInputLink(System::String^ sourceQueue, bool exclusive, bool temporary, System::String^ filterKey, System::String^ exchange); - void Bind(System::String^ queue, System::String^ exchange, System::String^ filterKey); - -internal: - AmqpSession(AmqpConnection^ connection, qpid::client::Connection* qpidConnection); - void NotifyClosed(); - CompletionWaiter^ SendMessage (System::String^ queue, MessageBodyStream ^mbody, TimeSpan timeout, bool async, AsyncCallback^ callback, Object^ state); - void ConnectionClosed(); - void internalWaitForCompletion(IntPtr future); - void removeWaiter(CompletionWaiter^ waiter); - bool MessageStop(std::string &name); - void AcceptAndComplete(SequenceSet& transfers, bool browsing); - IntPtr BeginPhase0Flush(XaTransaction^); - void EndPhase0Flush(XaTransaction^, IntPtr); - IntPtr DtxStart(IntPtr xidp, bool, bool); - IntPtr DtxPrepare(IntPtr xidp); - IntPtr DtxCommit(IntPtr xidp, bool onePhase); - IntPtr DtxRollback(IntPtr xidp); - void ReleaseCompletion(IntPtr completion); - IntPtr BorrowNativeSession(); - void ReturnNativeSession(); - - property AmqpConnection^ Connection { - AmqpConnection^ get () { return connection; } - } -}; - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/AssemblyInfo.cpp b/qpid/wcf/src/Apache/Qpid/Interop/AssemblyInfo.cpp deleted file mode 100644 index 91c23ae30a..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/AssemblyInfo.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -* 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 namespace System; -using namespace System::Reflection; -using namespace System::Runtime::CompilerServices; -using namespace System::Runtime::InteropServices; -using namespace System::Security::Permissions; - -// -// 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:AssemblyTitleAttribute("Apache.Qpid.Interop")]; -[assembly:AssemblyDescriptionAttribute("")]; -[assembly:AssemblyConfigurationAttribute("")]; -[assembly:AssemblyCompanyAttribute("")]; -[assembly:AssemblyProductAttribute("")]; -[assembly:AssemblyCopyrightAttribute("")]; -[assembly:AssemblyTrademarkAttribute("")]; -[assembly:AssemblyCultureAttribute("")]; - -// -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the value or you can default the Revision and Build Numbers -// by using the '*' as shown below: - -[assembly:AssemblyVersionAttribute("1.0.*")]; - -[assembly:ComVisible(false)]; - -[assembly:CLSCompliantAttribute(true)]; - -[assembly:SecurityPermission(SecurityAction::RequestMinimum, UnmanagedCode = true)]; diff --git a/qpid/wcf/src/Apache/Qpid/Interop/CompletionWaiter.cpp b/qpid/wcf/src/Apache/Qpid/Interop/CompletionWaiter.cpp deleted file mode 100644 index e39ee1b1ae..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/CompletionWaiter.cpp +++ /dev/null @@ -1,145 +0,0 @@ -/* -* 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. -*/ - -#include <windows.h> -#include <msclr\lock.h> - -#include "qpid/client/AsyncSession.h" -#include "qpid/framing/FrameSet.h" -#include "qpid/client/SubscriptionManager.h" -#include "qpid/client/Connection.h" -#include "qpid/client/Message.h" -#include "qpid/client/MessageListener.h" -#include "qpid/client/Demux.h" -#include "qpid/client/SessionImpl.h" -#include "qpid/client/SessionBase_0_10Access.h" - -#include "MessageBodyStream.h" -#include "AmqpMessage.h" -#include "AmqpSession.h" -#include "InputLink.h" -#include "CompletionWaiter.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Threading; -using namespace msclr; - -// A class to provide IAsyncResult semantics for a qpid AsyncSession command (i.e. 0-10 messageTransfer) -// when the client session receives a "Completion" notification from the Broker. - - -CompletionWaiter::CompletionWaiter(AmqpSession^ parent, TimeSpan timeSpan, IntPtr future, AsyncCallback^ callback, Object^ state) -{ - this->qpidFuture = future; - this->asyncCallback = callback; - this->state = state; - this->parent = parent; - this->thisLock = gcnew Object(); - // do this after the Completion Waiter is fully initialized, in case of - // very small timespan - if (timeSpan != TimeSpan::MaxValue) { - this->timer = gcnew Timer(timeoutCallback, this, timeSpan, TimeSpan::FromMilliseconds(-1)); - } -} - - -void CompletionWaiter::WaitForCompletion() -{ - if (isCompleted) - return; - - lock l(thisLock); - while (!isCompleted) { - Monitor::Wait(thisLock); - } -} - -void CompletionWaiter::Run() -{ - // no locks required in this method - if (isCompleted) - return; - - try { - // Wait for the arrival of the "AMQP Completion" indication from the Broker - parent->internalWaitForCompletion(qpidFuture); - } - catch (System::Exception^ e) { - runException = e; - } - finally { - delete(qpidFuture.ToPointer()); - qpidFuture = (IntPtr) NULL; - } - - if (timer != nullptr) { - timer->~Timer(); - timer = nullptr; - } - - Complete(false); -} - - -// "Complete" here means complete the AsyncResult, which may precede broker "command completion" if timed out - -void CompletionWaiter::Complete(bool isTimerThread) -{ - lock l(thisLock); - if (isCompleted) - return; - - isCompleted = true; - if (isTimerThread) - timedOut = true; - - Monitor::PulseAll(thisLock); - - // do this check and signal while locked - if (asyncWaitHandle != nullptr) - asyncWaitHandle->Set(); - - l.release(); - - parent->removeWaiter(this); - - if (asyncCallback != nullptr) { - // guard against application callback exception - try { - asyncCallback(this); - } - catch (System::Exception^) { - // log it? - } - } -} - - -void CompletionWaiter::TimeoutCallback(Object^ state) -{ - CompletionWaiter^ waiter = (CompletionWaiter^) state; - waiter->Complete(true); -} - - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/CompletionWaiter.h b/qpid/wcf/src/Apache/Qpid/Interop/CompletionWaiter.h deleted file mode 100644 index 88880c3721..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/CompletionWaiter.h +++ /dev/null @@ -1,98 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Threading; - -public ref class CompletionWaiter : IAsyncResult -{ -private: - bool timedOut; - // has an owner thread - bool assigned; - System::Exception^ runException; - AsyncCallback^ asyncCallback; - Threading::Timer ^timer; - bool isCompleted; - Object^ state; - Object^ thisLock; - ManualResetEvent^ asyncWaitHandle; - AmqpSession^ parent; - IntPtr qpidFuture; - void Complete(bool isTimerThread); - static void TimeoutCallback(Object^ state); - static TimerCallback^ timeoutCallback = gcnew TimerCallback(CompletionWaiter::TimeoutCallback); - - internal: - CompletionWaiter(AmqpSession^ parent, TimeSpan timeSpan, IntPtr future, AsyncCallback ^callback, Object^ state); - - void Run(); - void WaitForCompletion(); - - property bool Assigned { - bool get () { return assigned; } - } - - property bool TimedOut { - bool get () { return timedOut; } - } - - - public: - - virtual property bool IsCompleted { - bool get () { return isCompleted; } - } - - virtual property bool CompletedSynchronously { - bool get () { return false; } - } - - virtual property WaitHandle^ AsyncWaitHandle { - WaitHandle^ get () { - if (asyncWaitHandle != nullptr) { - return asyncWaitHandle; - } - - msclr::lock l(thisLock); - if (asyncWaitHandle == nullptr) { - asyncWaitHandle = gcnew ManualResetEvent(isCompleted); - } - return asyncWaitHandle; - } - } - - - virtual property Object^ AsyncState { - Object^ get () { return state; } - } - - - - -}; - -}}} // namespace Apache::Qpid::Interop - diff --git a/qpid/wcf/src/Apache/Qpid/Interop/DtxResourceManager.cpp b/qpid/wcf/src/Apache/Qpid/Interop/DtxResourceManager.cpp deleted file mode 100644 index 6ea31f8401..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/DtxResourceManager.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/*
-* 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.
-*/
-
-#include <windows.h>
-#include <msclr\lock.h>
-#include <transact.h>
-#include <xolehlp.h>
-#include <txdtc.h>
-#include <oletx2xa.h>
-#include <iostream>
-#include <fstream>
-
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/client/Connection.h"
-#include "qpid/client/Message.h"
-#include "qpid/client/MessageListener.h"
-#include "qpid/framing/FrameSet.h"
-
-#include "AmqpConnection.h"
-#include "AmqpSession.h"
-#include "DtxResourceManager.h"
-#include "XaTransaction.h"
-#include "QpidException.h"
-#include "QpidMarshal.h"
-
-namespace Apache {
-namespace Qpid {
-namespace Interop {
-
-using namespace System;
-using namespace System::Runtime::InteropServices;
-using namespace System::Transactions;
-using namespace msclr;
-
-
-/*
- * There is one DtxResourceManager per broker and per application process.
- *
- * Each RM manages a collection of active XaTransaction objects. Participating AmqpSessions enlist
- * (or re-enlist) with an XaTransaction indexed by the corresponding System.Transaction object. The
- * RM maintains its own AmqpSession for sending 2PC commnds (dtxPrepare, dtxCommit etc.). The
- * XaTransaction object works through the lifecycle of the Transaction, including prompting the
- * enlisted sessions to send their delimiting dtxEnd commands.
- *
- * A separate DtcPlugin.cpp file provides the recovery logic when needed in a library named
- * qpidxarm.dll. The MSDTC maintans recovery info in its log and tracks when there may be
- * transactions in doubt. See the documentation for IDtcToXaHelperSinglePipe.
- *
- * To enable transaction support:
- * DTC requires a registry key to find the plugin
- * [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\XADLL] qpidxarm.dll -> [path to qpidxarm.dll]
- * DTC needs to be configured for XA
- * cmdprompt -> dcomcnfg -> Component services -> My Computer -> DTC -> Local DTC -> right click properties -> Security -> Enable XA Transactions
- *
- */
-
-// TODO: provide shutdown mechanism, perhaps callback from Connection Idle for enlisted connections.
-// But note that a new RM registration with the DTC is very expensive.
-
-
-DtxResourceManager::DtxResourceManager(AmqpConnection^ appConnection) {
- dtcComp = NULL;
- xaHelperp = NULL;
- rmCookie = 0;
- doubtCount = 0;
- tmDown = false;
- AmqpConnection^ clonedCon = appConnection->Clone();
- dtxControlSession = clonedCon->CreateSession();
- dataSourceName = clonedCon->DataSourceName;
- transactionMap = gcnew Collections::Generic::Dictionary<Transaction^, XaTransaction^>();
-
- HRESULT hr;
-
- try {
- // instead of pinning this instance, just use tmp stack variables for small stuff
- IUnknown* tmp = NULL;
- // request the default DTC
- hr = DtcGetTransactionManager(NULL, NULL, IID_IUnknown, 0, 0, 0, (void **)&tmp);
- if (hr != S_OK)
- throw gcnew QpidException("connection failure to DTC service");
- dtcComp = tmp;
-
- IDtcToXaHelperSinglePipe *tmp2 = NULL;
- hr = ((IUnknown *)dtcComp)->QueryInterface(IID_IDtcToXaHelperSinglePipe, (void**) &tmp2);
- if (hr != S_OK)
- throw gcnew QpidException("DTC XA unavailable");
- xaHelperp = tmp2;
-
- std::string native_dsn = QpidMarshal::ToNative(dataSourceName);
- DWORD tmp3;
-
- // This call doesn't return until the DTC has opened and closed a connection to the broker
- // and written a recovery entry in its log.
- hr = ((IDtcToXaHelperSinglePipe *) xaHelperp)->XARMCreate(const_cast<char *>(native_dsn.c_str()), "qpidxarm.dll", &tmp3);
- if (hr != S_OK) {
- switch (hr) {
- case E_FAIL:
- throw gcnew QpidException("Resource Manager DLL configuration error");
- case E_INVALIDARG:
- throw gcnew QpidException("Resource Manager internal error");
- case E_OUTOFMEMORY:
- throw gcnew QpidException("Resource Manager out of memory");
- case E_UNEXPECTED:
- throw gcnew QpidException("Resource Manager internal failure");
- case XACT_E_TMNOTAVAILABLE:
- case XACT_E_CONNECTION_DOWN:
- throw gcnew QpidException("MSDTC unavailable");
-
- default:
- throw gcnew QpidException("Resource Manager Registration failed");
- }
- }
-
- rmCookie = tmp3;
- }
- finally {
- if (rmCookie == 0) {
- // undo partial construction
- Cleanup();
- }
- }
-}
-
-
-DtxResourceManager::!DtxResourceManager() {
- Cleanup();
-}
-
-
-DtxResourceManager::~DtxResourceManager() {
- GC::SuppressFinalize(this);
- Cleanup();
-}
-
-
-// Called when the DTC COM proxy sends TMDOWN to a pending XaTransaction
-// called once for each outstanding tx
-
-void DtxResourceManager::TmDown() {
- // this block is the only place where both locks are held
- lock l1(transactionMap);
- lock l2(resourceManagerMap);
- if (tmDown)
- return;
-
- tmDown = true;
- resourceManagerMap->Remove(this->dataSourceName);
- // defer cleanup until last TmDown notification received
-}
-
-
-
-void DtxResourceManager::Cleanup() {
- for each (Collections::Generic::KeyValuePair<Transaction^, XaTransaction^> kvp in transactionMap) {
- XaTransaction^ xaTr = kvp.Value;
- xaTr->ChildFinalize();
- }
-
- try {
- if (rmCookie != 0) {
- // implies no recovery needed
- bool cleanSession = (doubtCount == 0) && (transactionMap->Count == 0);
- ((IDtcToXaHelperSinglePipe *)xaHelperp)->ReleaseRMCookie(rmCookie, cleanSession);
- rmCookie = 0;
- }
-
-
- if (xaHelperp != NULL) {
- ((IDtcToXaHelperSinglePipe *) xaHelperp)->Release();
- xaHelperp = NULL;
- }
-
- if (dtcComp != NULL) {
- ((IUnknown *) dtcComp)->Release();
- dtcComp = NULL;
- }
-
- if (dtxControlSession != nullptr) {
- dtxControlSession->Connection->Close();
- }
-
- }
- catch (Exception^) {}
-}
-
-
-XaTransaction^ DtxResourceManager::GetXaTransaction(AmqpSession^ appSession, Transaction^ transaction) {
- // find or create the RM instance associated with the session's broker
- AmqpConnection^ connection = appSession->Connection;
- DtxResourceManager^ instance = connection->CachedResourceManager;
-
- // try cached rm first
- if (instance != nullptr) {
- XaTransaction^ xaTx = instance->InternalGetXaTransaction(appSession, transaction);
- if (xaTx != nullptr)
- return xaTx;
- else {
- // cached version no longer available, force new rm creation
- connection->CachedResourceManager = nullptr;
- }
- }
-
- lock l(resourceManagerMap);
- String^ dsn = connection->DataSourceName;
- if (!resourceManagerMap->TryGetValue(dsn, instance)) {
- instance = gcnew DtxResourceManager(connection->Clone());
- resourceManagerMap->Add(dsn, instance);
- connection->CachedResourceManager = instance;
- }
- l.release();
-
- return instance->InternalGetXaTransaction(appSession, transaction);
-}
-
-
-XaTransaction^ DtxResourceManager::InternalGetXaTransaction(AmqpSession^ appSession, Transaction^ transaction) {
- // find or create the tx proxy instance associated with the DTC transaction
- lock l(transactionMap);
- if (tmDown)
- return nullptr;
-
- XaTransaction^ xaTransaction = nullptr;
- if (!transactionMap->TryGetValue(transaction, xaTransaction)) {
- xaTransaction = gcnew XaTransaction(transaction, (IDtcToXaHelperSinglePipe *) xaHelperp, rmCookie, this);
- transactionMap->Add(transaction, xaTransaction);
- }
-
- return xaTransaction;
-}
-
-void DtxResourceManager::Complete(Transaction ^tx) {
- lock l(transactionMap);
- transactionMap->Remove(tx);
-
- if (tmDown && (transactionMap->Count == 0)) {
- // no more activity on this instance
- GC::SuppressFinalize(this);
- Cleanup();
- }
-}
-
-
-void DtxResourceManager::IncrementDoubt() {
- Interlocked::Increment(doubtCount);
-}
-
-
-void DtxResourceManager::DecrementDoubt() {
- Interlocked::Decrement(doubtCount);
-}
-
-
-#ifdef QPID_RECOVERY_TEST_HOOK
-void DtxResourceManager::ForceRecovery(Transaction ^tx) {
- lock l(resourceManagerMap);
- for each (Collections::Generic::KeyValuePair<System::String^, DtxResourceManager^> kvp in resourceManagerMap) {
-
- Collections::Generic::Dictionary<Transaction^, XaTransaction^>^ txmap = kvp.Value->transactionMap;
- XaTransaction^ xaTransaction = nullptr;
- lock l2(txmap);
- if (txmap->TryGetValue(tx, xaTransaction)) {
- xaTransaction->ForceRecovery();
- }
- }
-}
-#endif
-
-}}} // namespace Apache::Qpid::Interop
diff --git a/qpid/wcf/src/Apache/Qpid/Interop/DtxResourceManager.h b/qpid/wcf/src/Apache/Qpid/Interop/DtxResourceManager.h deleted file mode 100644 index 7df491eec2..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/DtxResourceManager.h +++ /dev/null @@ -1,76 +0,0 @@ -/*
-* 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.
-*/
-
-#pragma once
-
-namespace Apache {
-namespace Qpid {
-namespace Interop {
-
-using namespace System;
-using namespace System::Threading;
-using namespace System::Transactions;
-
-ref class XaTransaction;
-
-public ref class DtxResourceManager
-{
-private:
- // Receive() or WaitForMessage()
- AmqpSession^ dtxControlSession;
- String^ dataSourceName;
- bool consumed;
- DWORD rmCookie;
- void* xaHelperp;
- void* dtcComp;
- int doubtCount;
- DtxResourceManager(AmqpConnection^);
- XaTransaction^ InternalGetXaTransaction (AmqpSession^ session, Transaction^ transaction);
- bool tmDown;
-
- // The active transactions
- Collections::Generic::Dictionary<Transaction^, XaTransaction^>^ transactionMap;
-
- // one resource manager per AMQP broker per process
- static Collections::Generic::Dictionary<System::String^, DtxResourceManager^>^ resourceManagerMap =
- gcnew Collections::Generic::Dictionary<System::String^, DtxResourceManager^>();
-
- void Cleanup();
- ~DtxResourceManager();
- !DtxResourceManager();
-
-internal:
- static XaTransaction^ GetXaTransaction (AmqpSession^ session, Transaction^ transaction);
- void Complete(Transaction ^tx);
- void TmDown();
-
- property AmqpSession^ DtxControlSession {
- AmqpSession^ get () { return dtxControlSession; }
- }
-
- void IncrementDoubt();
- void DecrementDoubt();
-
-#ifdef QPID_RECOVERY_TEST_HOOK
-public:
- static void ForceRecovery(Transaction ^tx);
-#endif
-};
-
-}}} // namespace Apache::Qpid::Interop
diff --git a/qpid/wcf/src/Apache/Qpid/Interop/InputLink.cpp b/qpid/wcf/src/Apache/Qpid/Interop/InputLink.cpp deleted file mode 100644 index f8189df0dd..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/InputLink.cpp +++ /dev/null @@ -1,868 +0,0 @@ -/* -* 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. -*/ - -#include <windows.h> -#include <msclr\lock.h> - -#include "qpid/client/AsyncSession.h" -#include "qpid/framing/FieldValue.h" -#include "qpid/framing/FrameSet.h" -#include "qpid/client/SubscriptionManager.h" -#include "qpid/client/Connection.h" -#include "qpid/client/Message.h" -#include "qpid/client/MessageListener.h" -#include "qpid/client/Demux.h" -#include "qpid/client/SessionImpl.h" -#include "qpid/client/SessionBase_0_10Access.h" - -#include "MessageBodyStream.h" -#include "AmqpMessage.h" -#include "AmqpSession.h" -#include "InputLink.h" -#include "QpidMarshal.h" -#include "QpidException.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - - -using namespace System; -using namespace System::Runtime::InteropServices; -using namespace System::Threading; -using namespace msclr; - -using namespace qpid::client; -using namespace qpid::framing; - -using namespace std; - -using namespace Apache::Qpid::AmqpTypes; - -// Scalability note: When using async methods, an async helper thread is created -// to block on the Demux BlockingQueue. This design should be revised in line -// with proposed changes to the native library to reduce the number of servicing -// threads for large numbers of subscriptions. - -// synchronization is accomplished with locks, but also by ensuring that only one -// MessageWaiter (the one at the front of the line) is ever active. -// async threads to watch for: Close/finalizer, Timers, SyncCredit and the native Dispatch -// thread (who deposits FrameSets into the local queue and is oblivious to the -// managed space locks). - - -// The folowing def must match the "Frames" private typedef. -// TODO, make Qpid-cpp "Frames" definition visible. -typedef qpid::InlineVector<AMQFrame, 4> FrameSetFrames; - -InputLink::InputLink(AmqpSession^ session, System::String^ sourceQueue, - qpid::client::AsyncSession *qpidSessionp, qpid::client::SubscriptionManager *qpidSubsMgrp, - bool exclusive, - bool temporary, System::String^ filterKey, System::String^ exchange) : - amqpSession(session), - subscriptionp(NULL), - localQueuep(NULL), - queuePtrp(NULL), - dequeuedFrameSetpp(NULL), - disposed(false), - finalizing(false) -{ - bool success = false; - System::Exception^ linkException = nullptr; - - waiters = gcnew Collections::Generic::List<MessageWaiter^>(); - linkLock = waiters; // private and available - subscriptionLock = gcnew Object(); - qpidAddress = QpidAddress::CreateAddress(sourceQueue, true); - qpidAddress->ResolveLink(session); - browsing = qpidAddress->Browsing; - - try { - std::string qname = QpidMarshal::ToNative(qpidAddress->LinkName); - - if (temporary) { - qpidSessionp->queueDeclare(arg::queue=qname, arg::durable=false, arg::autoDelete=true, arg::exclusive=true); - qpidSessionp->exchangeBind(arg::exchange=QpidMarshal::ToNative(exchange), - arg::queue=qname, arg::bindingKey=QpidMarshal::ToNative(filterKey)); - qpidSessionp->sync(); - } - - localQueuep = new LocalQueue; - SubscriptionSettings settings; - settings.flowControl = FlowControl::messageCredit(0); - settings.completionMode = CompletionMode::MANUAL_COMPLETION; - - if (browsing) { - settings.acquireMode = AcquireMode::ACQUIRE_MODE_NOT_ACQUIRED; - settings.acceptMode = AcceptMode::ACCEPT_MODE_NONE; - } - else { - settings.acquireMode = AcquireMode::ACQUIRE_MODE_PRE_ACQUIRED; - settings.acceptMode = AcceptMode::ACCEPT_MODE_EXPLICIT; - } - - Subscription sub = qpidSubsMgrp->subscribe(*localQueuep, qname, settings); - subscriptionp = new Subscription (sub); // copy smart pointer for later IDisposable cleanup - - // the roundabout way to obtain localQueuep->queue - SessionBase_0_10Access sa(*qpidSessionp); - boost::shared_ptr<SessionImpl> simpl = sa.get(); - queuePtrp = new Demux::QueuePtr(simpl->getDemux().get(sub.getName())); - - success = true; - } finally { - if (!success) { - Cleanup(); - linkException = gcnew QpidException ("InputLink creation failure"); - throw linkException; - } - } -} - -// called with lock held -void InputLink::ReleaseNative() -{ - // involves talking to the Broker unless the connection is broken - - if ((subscriptionp != NULL) && !finalizing) { - // TODO: find boost time error on cleanup when in finalizer thread - try { - subscriptionp->cancel(); - } - catch (const std::exception& error) { - // TODO: log this properly - std::cout << "shutdown error " << error.what() << std::endl; - } - } - - // free native mem (or smart pointers) that we own - if (subscriptionp != NULL) { - delete subscriptionp; - subscriptionp = NULL; - } - if (queuePtrp != NULL) { - delete queuePtrp; - queuePtrp = NULL; - } - if (localQueuep != NULL) { - if (!finalizing) { - // TODO: find boost time error on cleanup when in finalizer thread - delete localQueuep; - localQueuep = NULL; - } - } - if (dequeuedFrameSetpp != NULL) { - delete dequeuedFrameSetpp; - dequeuedFrameSetpp = NULL; - } -} - -void InputLink::Cleanup() -{ - { - lock l(linkLock); - if (disposed) - return; - - disposed = true; - - // if the asyncHelper exists and is idle, unblock it - if (asyncHelperWaitHandle != nullptr) { - asyncHelperWaitHandle->Set(); - } - - // wakeup anyone waiting for messages - if (queuePtrp != NULL) - (*queuePtrp)->close(); - - // wait for any sync operations on the subscription to complete before ReleaseNative - lock l2(subscriptionLock); - - try {} - finally - { - ReleaseNative(); - } - } - - // Now that subscription is torn down, we can execute pending delete on remote node - qpidAddress->CleanupLink(amqpSession); - amqpSession->NotifyClosed(); -} - -InputLink::~InputLink() -{ - Cleanup(); -} - -InputLink::!InputLink() -{ - finalizing = true; - Cleanup(); -} - -void InputLink::Close() -{ - // Simulate Dispose()... - Cleanup(); - GC::SuppressFinalize(this); -} - -// call with lock held -bool InputLink::haveMessage() -{ - if (dequeuedFrameSetpp != NULL) - return true; - - if (queuePtrp != NULL) { - if ((*queuePtrp)->size() > 0) - return true; - } - return false; -} - -IntPtr InputLink::nextLocalMessage() -{ - lock l(linkLock); - - if (disposed) - return (IntPtr) NULL; - - // A message already pulled off BlockingQueue? - if (dequeuedFrameSetpp != NULL) { - QpidFrameSetPtr* rv = dequeuedFrameSetpp; - dequeuedFrameSetpp = NULL; - return (IntPtr) rv; - } - - if ((*queuePtrp)->empty()) - return (IntPtr) NULL; - - bool received = false; - QpidFrameSetPtr* frameSetpp = new QpidFrameSetPtr; - - try { - received = (*queuePtrp)->pop(*frameSetpp, qpid::sys::TIME_INFINITE); - if (received) { - QpidFrameSetPtr* rv = frameSetpp; - // no need to free native in finally block - frameSetpp = NULL; - return (IntPtr) rv; - } - } catch(const std::exception& error) { - // should be no async tampering with queue since we hold the lock and have a - // smart pointer ref to the native LocalQueue, even if the network connection fails... - cout << "unknown exception in InputLink.nextLocalMessage() " << error.what() <<endl; - // TODO: log this - } - finally { - if (frameSetpp != NULL) { - delete frameSetpp; - } - } - - return (IntPtr) NULL; -} - - - -void InputLink::unblockWaiter() -{ - // to be followed by resetQueue() below - lock l(linkLock); - if (disposed) - return; - (*queuePtrp)->close(); -} - - - -// Set things right after unblockWaiter(). Closing and opening a Qpid BlockingQueue unsticks -// a blocking thread without interefering with queue contents or the ability to push -// new incoming messages. - -void InputLink::resetQueue() -{ - lock l(linkLock); - if (disposed) - return; - if ((*queuePtrp)->isClosed()) { - (*queuePtrp)->open(); - } -} - - -// returns true if there is a message to consume, i.e. nextLocalMessage() won't block - -bool InputLink::internalWaitForMessage() -{ - Demux::QueuePtr demuxQueuePtr; - - bool received = false; - QpidFrameSetPtr* frameSetpp = NULL; - try { - lock l(linkLock); - if (disposed) - return false; - if (haveMessage()) - return true; - - AdjustCredit(); - - // get a scoped smart ptr ref to guard against async close or hangup - demuxQueuePtr = *queuePtrp; - frameSetpp = new QpidFrameSetPtr; - - l.release(); - // Async cleanup is now possible. Only use demuxQueuePtr until lock reacquired. - received = demuxQueuePtr->pop(*frameSetpp, qpid::sys::TIME_INFINITE); - l.acquire(); - - if (received) { - dequeuedFrameSetpp = frameSetpp; - frameSetpp = NULL; // native will eventually be freed in Cleanup or MessageBodyStream - } - - return true; - } catch(const std::exception& ) { - // timeout or connection closed - return false; - } - finally { - if (frameSetpp != NULL) { - delete frameSetpp; - } - } - - return false; -} - - -// call with lock held -void InputLink::addWaiter(MessageWaiter^ waiter) -{ - waiters->Add(waiter); - if (waiters->Count == 1) { - // mark this waiter as ready to run - // Only the waiter at the head of the queue is active. - waiter->Activate(); - } - - if (waiter->Assigned) - return; - - if (asyncHelperWaitHandle == nullptr) { - asyncHelperWaitHandle = gcnew ManualResetEvent(false); - ThreadStart^ threadDelegate = gcnew ThreadStart(this, &InputLink::asyncHelper); - (gcnew Thread(threadDelegate))->Start(); - } - - if (waiters->Count == 1) { - // wake up the asyncHelper - asyncHelperWaitHandle->Set(); - } -} - - -void InputLink::removeWaiter(MessageWaiter^ waiter) { - // a waiter can be removed from anywhere in the list if timed out - - lock l(linkLock); - int idx = waiters->IndexOf(waiter); - if (idx == -1) { - // TODO: assert or log - if (asyncHelperWaitHandle != nullptr) { - // just in case. - asyncHelperWaitHandle->Set(); - } - return; - } - - waiters->RemoveAt(idx); - if (waiter->TimedOut) { - // may have to give back message if it arrives momentarily - AdjustCredit(); - } - - // let the next waiter know it's his turn. - if (waiters->Count > 0) { - MessageWaiter^ nextWaiter = waiters[0]; - - // wakeup the asyncHelper thread to help out if necessary. - if (!nextWaiter->Assigned) { - asyncHelperWaitHandle->Set(); - } - - l.release(); - nextWaiter->Activate(); - return; - } - else { - if (disposed && (asyncHelperWaitHandle != nullptr)) { - asyncHelperWaitHandle->Set(); - } - } -} - - -void InputLink::asyncHelper() -{ - lock l(linkLock); - - while (true) { - if (disposed && (waiters->Count == 0)) { - asyncHelperWaitHandle = nullptr; - return; - } - - if (waiters->Count > 0) { - MessageWaiter^ waiter = waiters[0]; - - l.release(); - if (waiter->AcceptForWork()) { - waiter->Run(); - } - l.acquire(); - } - - // sleep if more work may be coming or it is currently someone else's turn - if (((waiters->Count == 0) && !disposed) || ((waiters->Count != 0) && waiters[0]->Assigned)) { - // wait for something to do - asyncHelperWaitHandle->Reset(); - l.release(); - asyncHelperWaitHandle->WaitOne(); - l.acquire(); - } - } -} - -void InputLink::sync() -{ - // used by the MessageWaiter timeout thread to not run before fully initialized - lock l(linkLock); -} - - -void InputLink::PrefetchLimit::set(int value) -{ - lock l(linkLock); - prefetchLimit = value; - - int delta = 0; - - // rough rule of thumb to keep the flow, but reduce chatter. - // for small messages, the credit request is almost as expensive as the transfer itself. - // experience may suggest a better heuristic or require a property for the low water mark - if (prefetchLimit >= 3) { - delta = prefetchLimit / 3; - } - minWorkingCredit = prefetchLimit - delta; - AdjustCredit(); -} - - -// call with lock held -void InputLink::AdjustCredit() -{ - if (creditSyncPending || disposed) - return; - - // low watermark check - if ((prefetchLimit != 0) && - (workingCredit >= minWorkingCredit) && - (workingCredit >= waiters->Count)) - return; - - // should have enough for all waiters or to satisfy the prefetch window - int targetCredit = waiters->Count; - if (targetCredit < prefetchLimit) - targetCredit = prefetchLimit; - - if (targetCredit > workingCredit) { - subscriptionp->grantMessageCredit(targetCredit - workingCredit); - workingCredit = targetCredit; - return; - } - if (targetCredit < workingCredit) { - if ((targetCredit == 0) && (prefetchLimit == 0)) { - creditSyncPending = true; - ThreadPool::QueueUserWorkItem(gcnew WaitCallback(this, &InputLink::SyncCredit)); - } - // TODO: also shrink credit when prefetchLimit != 0 - } -} - -void InputLink::SyncCredit(Object ^unused) -{ - lock l(linkLock); - - try { - if (disposed) - return; - - if (!amqpSession->MessageStop(subscriptionp->getName())) { - // connection closed - return; - } - - l.release(); - // use setFlowControl to re-enable credit flow on the broker. - // setFlowControl is a sync operation - { - lock l2(subscriptionLock); - if (subscriptionp != NULL) { - subscriptionp->setFlowControl(subscriptionp->getSettings().flowControl); - } - } - l.acquire(); - - if (disposed) - return; - - // let existing waiters use up any messages that arrived. - // local queue size can only decrease until more credit is issued - while (true) { - if ((waiters->Count > 0) && ((*queuePtrp)->size() > 0)) { - l.release(); - // a rare use case and not used in performance oriented code. - // optimization can wait until the qpid/messaging api is used - Thread::Sleep(10); - l.acquire(); - if (disposed) - return; - } - else { - break; - } - } - - // At this point, the lock is held and we are fully synced with the broker - // so we have a valid snapshot - - if ((prefetchLimit == 0) && ((*queuePtrp)->size() > 0)) { - // can't be sure application will request a message again any time soon - QpidFrameSetPtr frameSetp; - while (!(*queuePtrp)->empty()) { - (*queuePtrp)->pop(frameSetp); - SequenceSet frameSetID(frameSetp->getId()); - subscriptionp->release(frameSetID); - } - - // don't touch dequeuedFrameSetpp. It is spoken for: explicitely from a - // MessageWaiter about to to get the nextLocalMessage(), or implicitely - // from a WaitForMessage(). - } - // TODO: if prefetchLimit != 0, release messages from back of the queue that exceed targetCredit - - workingCredit = (*queuePtrp)->size(); - if (dequeuedFrameSetpp != NULL) { - workingCredit++; - } - } - finally { - creditSyncPending = false; - } - - AdjustCredit(); -} - - -AmqpMessage^ InputLink::createAmqpMessage(IntPtr msgp) -{ - QpidFrameSetPtr* fspp = (QpidFrameSetPtr*) msgp.ToPointer(); - bool ownFrameSet = true; - bool haveProperties = false; - - try { - MessageBodyStream^ mstream = gcnew MessageBodyStream(fspp); - ownFrameSet = false; // stream releases on close/dispose - - AmqpMessage^ amqpMessage = gcnew AmqpMessage(mstream); - - AMQHeaderBody* headerBodyp = (*fspp)->getHeaders(); - uint64_t contentSize = (*fspp)->getContentSize(); - SequenceSet frameSetID((*fspp)->getId()); - - // target managed representation - AmqpProperties^ amqpProperties = gcnew AmqpProperties(); - - // source native representation - const DeliveryProperties* deliveryProperties = headerBodyp->get<DeliveryProperties>(); - const qpid::framing::MessageProperties* messageProperties = headerBodyp->get<qpid::framing::MessageProperties>(); - - if (deliveryProperties) { - if (deliveryProperties->hasRoutingKey()) { - haveProperties = true; - - amqpProperties->RoutingKey = gcnew String(deliveryProperties->getRoutingKey().c_str()); - } - - if (deliveryProperties->hasDeliveryMode()) { - if (deliveryProperties->getDeliveryMode() == qpid::framing::PERSISTENT) - amqpProperties->Durable = true; - } - - if (deliveryProperties->hasTtl()) { - long long ticks = deliveryProperties->getTtl() * TimeSpan::TicksPerMillisecond; - amqpProperties->TimeToLive = Nullable<TimeSpan>(TimeSpan::FromTicks(ticks)); - } - } - - if (messageProperties) { - - if (messageProperties->hasReplyTo()) { - haveProperties = true; - const ReplyTo& rpto = messageProperties->getReplyTo(); - String^ rk = nullptr; - String^ ex = nullptr; - if (rpto.hasRoutingKey()) { - rk = gcnew String(rpto.getRoutingKey().c_str()); - } - if (rpto.hasExchange()) { - ex = gcnew String(rpto.getExchange().c_str()); - } - amqpProperties->SetReplyTo(ex,rk); - } - - if (messageProperties->hasContentType()) { - haveProperties = true; - amqpProperties->ContentType = gcnew String(messageProperties->getContentType().c_str()); - - if (messageProperties->hasContentEncoding()) { - String^ enc = gcnew String(messageProperties->getContentEncoding().c_str()); - if (!String::IsNullOrEmpty(enc)) { - // TODO: properly assemble 1.0 style to 0-10 for all cases - amqpProperties->ContentType += "; charset=" + enc; - } - } - } - - if (messageProperties->hasCorrelationId()) { - haveProperties = true; - const std::string& ncid = messageProperties->getCorrelationId(); - int len = ncid.size(); - array<unsigned char>^ mcid = gcnew array<unsigned char>(len); - Marshal::Copy ((IntPtr) (void *) ncid.data(), mcid, 0, len); - amqpProperties->CorrelationId = mcid; - } - - if (messageProperties->hasUserId()) { - haveProperties = true; - const std::string& nuid = messageProperties->getUserId(); - int len = nuid.size(); - array<unsigned char>^ muid = gcnew array<unsigned char>(len); - Marshal::Copy ((IntPtr) (void *) nuid.data(), muid, 0, len); - amqpProperties->UserId = muid; - } - - if (messageProperties->hasApplicationHeaders()) { - haveProperties = true; - const qpid::framing::FieldTable& fieldTable = messageProperties->getApplicationHeaders(); - int count = fieldTable.count(); - - if (count > 0) { - haveProperties = true; - Collections::Generic::Dictionary<System::String^, AmqpType^>^ mmap = - gcnew Collections::Generic::Dictionary<System::String^, AmqpType^>(count); - - for(qpid::framing::FieldTable::ValueMap::const_iterator i = fieldTable.begin(); i != fieldTable.end(); i++) { - - qpid::framing::FieldValue::Data &data = i->second->getData(); - - // TODO: replace these generic int/string conversions with handler for each AMQP specific type: - // uint8_t dataType = i->second->getType(); - // switch (dataType) { case TYPE_CODE_STR8: ... } - - if (data.convertsToInt()) { - mmap->Add (gcnew String(i->first.data()), gcnew AmqpInt((int) i->second->getData().getInt())); - } - if (data.convertsToString()) { - std::string ns = data.getString(); - String^ ms = gcnew String(ns.data(), 0, ns.size()); - mmap->Add (gcnew String(i->first.data()), gcnew AmqpString(ms)); - } - } - - amqpProperties->PropertyMap = mmap; - } - - } - } - - if (haveProperties) { - amqpMessage->Properties = amqpProperties; - } - - // We have a message we can return to the caller. - // Tell the broker we got it. - - // subscriptionp->accept(frameSetID) is a slow sync operation in the native API - // so do it within the AsyncSession directly - amqpSession->AcceptAndComplete(frameSetID, browsing); - - workingCredit--; - // check if more messages need to be requested from broker - AdjustCredit(); - - return amqpMessage; - } - finally { - if (ownFrameSet) - delete (fspp); - } -} - - // As for IInputChannel: - // if success, return true + amqpMessage - // elseif timeout, return false - // elseif closed/EOF, return true and amqpMessage = null - // else throw an Exception - -bool InputLink::TryReceive(TimeSpan timeout, [Out] AmqpMessage^% amqpMessage) -{ - lock l(linkLock); - - if (waiters->Count == 0) { - // see if there is a message already available without blocking - IntPtr fspp = nextLocalMessage(); - if (fspp.ToPointer() != NULL) { - amqpMessage = createAmqpMessage(fspp); - return true; - } - } - - MessageWaiter^ waiter = gcnew MessageWaiter(this, timeout, true, false, nullptr, nullptr); - addWaiter(waiter); - - l.release(); - waiter->Run(); - l.acquire(); - - if (waiter->TimedOut) { - return false; - } - - IntPtr waiterMsg = waiter->Message; - if (waiterMsg.ToPointer() == NULL) { - if (disposed) { - // indicate normal EOF on channel - amqpMessage = nullptr; - return true; - } - } - - amqpMessage = createAmqpMessage(waiterMsg); - return true; -} - -IAsyncResult^ InputLink::BeginTryReceive(TimeSpan timeout, AsyncCallback^ callback, Object^ state) -{ - - //TODO: if haveMessage() complete synchronously - - lock l(linkLock); - MessageWaiter^ waiter = gcnew MessageWaiter(this, timeout, true, true, callback, state); - addWaiter(waiter); - return waiter; -} - -bool InputLink::EndTryReceive(IAsyncResult^ result, [Out] AmqpMessage^% amqpMessage) -{ - - // TODO: validate result - - MessageWaiter^ waiter = (MessageWaiter ^) result; - - waiter->WaitForCompletion(); - - if (waiter->RunException != nullptr) - throw waiter->RunException; - - if (waiter->TimedOut) { - amqpMessage = nullptr; - return false; - } - - IntPtr waiterMsg = waiter->Message; - if (waiterMsg.ToPointer() == NULL) { - if (disposed) { - // indicate normal EOF on channel - amqpMessage = nullptr; - return true; - } - } - - amqpMessage = createAmqpMessage(waiterMsg); - return true; -} - - -bool InputLink::WaitForMessage(TimeSpan timeout) -{ - lock l(linkLock); - - if (disposed) - return false; - - if (waiters->Count == 0) { - // see if there is a message already available without blocking - if (haveMessage()) - return true; - } - - // Same as for TryReceive, except consuming = false - MessageWaiter^ waiter = gcnew MessageWaiter(this, timeout, false, false, nullptr, nullptr); - addWaiter(waiter); - - l.release(); - waiter->Run(); - l.acquire(); - - if (waiter->TimedOut) { - return false; - } - - return haveMessage(); -} - -IAsyncResult^ InputLink::BeginWaitForMessage(TimeSpan timeout, AsyncCallback^ callback, Object^ state) -{ - lock l(linkLock); - - // Same as for BeginTryReceive, except consuming = false - MessageWaiter^ waiter = gcnew MessageWaiter(this, timeout, false, true, callback, state); - addWaiter(waiter); - return waiter; -} - -bool InputLink::EndWaitForMessage(IAsyncResult^ result) -{ - MessageWaiter^ waiter = (MessageWaiter ^) result; - - waiter->WaitForCompletion(); - - if (waiter->TimedOut) { - return false; - } - - return haveMessage(); -} - - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/InputLink.h b/qpid/wcf/src/Apache/Qpid/Interop/InputLink.h deleted file mode 100644 index 136d53d280..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/InputLink.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -#include "MessageWaiter.h" -#include "QpidAddress.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Threading; -using namespace System::Runtime::InteropServices; - -using namespace qpid::client; -using namespace std; - -// smart pointer to the low level AMQP 0-10 frames of the message -typedef qpid::framing::FrameSet::shared_ptr QpidFrameSetPtr; - -public ref class InputLink -{ -private: - AmqpSession^ amqpSession; - Subscription* subscriptionp; - LocalQueue* localQueuep; - Demux::QueuePtr* queuePtrp; - Collections::Generic::List<MessageWaiter^>^ waiters; - bool disposed; - bool finalizing; - Object^ linkLock; - Object^ subscriptionLock; - QpidFrameSetPtr* dequeuedFrameSetpp; - ManualResetEvent^ asyncHelperWaitHandle; - // number of messages to buffer locally for future consumption - int prefetchLimit; - // the number of messages requested and not yet processed - int workingCredit; - // stopping and restarting the message flow - bool creditSyncPending; - // working credit low water mark - int minWorkingCredit; - - bool browsing; - QpidAddress^ qpidAddress; - - void Cleanup(); - void ReleaseNative(); - bool haveMessage(); - void addWaiter(MessageWaiter^ waiter); - void asyncHelper(); - AmqpMessage^ createAmqpMessage(IntPtr msgp); - void AdjustCredit(); - void SyncCredit(Object ^); - -internal: - InputLink(AmqpSession^ session, System::String^ sourceQueue, qpid::client::AsyncSession *qpidSessionp, - qpid::client::SubscriptionManager *qpidSubsMgrp, bool exclusive, bool temporary, System::String^ filterKey, - System::String^ exchange); - - bool internalWaitForMessage(); - void unblockWaiter(); - void resetQueue(); - IntPtr nextLocalMessage(); - void removeWaiter(MessageWaiter^ waiter); - void sync(); - -public: - ~InputLink(); - !InputLink(); - void Close(); - - bool TryReceive(TimeSpan timeout, [Out] AmqpMessage ^% amqpMessage); - IAsyncResult^ BeginTryReceive(TimeSpan timeout, AsyncCallback^ callback, Object^ state); - bool EndTryReceive(IAsyncResult^ result, [Out] AmqpMessage^% amqpMessage); - - bool WaitForMessage(TimeSpan timeout); - IAsyncResult^ BeginWaitForMessage(TimeSpan timeout, AsyncCallback^ callback, Object^ state); - bool EndWaitForMessage(IAsyncResult^ result); - - property int PrefetchLimit { - int get () { return prefetchLimit; } - void set (int value); - } - - property bool Browsing { - bool get () { return browsing; } - } - -}; - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/Interop.vcproj b/qpid/wcf/src/Apache/Qpid/Interop/Interop.vcproj deleted file mode 100644 index fe288cbe76..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/Interop.vcproj +++ /dev/null @@ -1,501 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<!--
-
- 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.
-
--->
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="Interop"
- ProjectGUID="{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}"
- RootNamespace="Interop"
- Keyword="ManagedCProj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- <Platform
- Name="x64"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="1"
- ManagedExtensions="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="copy ..\AmqpTypes\obj\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule $(ConfigurationName)"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000 /wd4244 /wd4800 /wd4355 /FU $(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
- Optimization="0"
- AdditionalIncludeDirectories=""$(QPID_BUILD_ROOT)\include";"$(QPID_BUILD_ROOT)\src";..\..\..\..\..\cpp\include;..\..\..\..\..\cpp\src;"$(BOOST_ROOT)""
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,BOOST_ALL_DYN_LINK,_CRT_NONSTDC_NO_WARNINGS,NOMINMAX,WIN32_LEAN_AND_MEAN,_SCL_SECURE_NO_WARNINGS,HAVE_CONFIG_H"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 $(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib xolehlp.lib $(QPID_BUILD_ROOT)\src\Debug\qpidclientd.lib $(QPID_BUILD_ROOT)\src\Debug\qpidcommond.lib rpcrt4.lib ws2_32.lib "
- OutputFile="$(OutDir)\Apache.Qpid.Interop.dll"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""$(BOOST_ROOT)\lib""
- GenerateDebugInformation="true"
- AssemblyDebug="1"
- TargetMachine="1"
- KeyFile="$(SolutionDir)\src\wcfnet.snk"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="1"
- ManagedExtensions="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="copy ..\AmqpTypes\obj\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule $(ConfigurationName)"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000 /wd4244 /wd4800 /wd4355 /FU $(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
- AdditionalIncludeDirectories=""$(QPID_BUILD_ROOT)\include";"$(QPID_BUILD_ROOT)\src";..\..\..\..\..\cpp\include;..\..\..\..\..\cpp\src;"$(BOOST_ROOT)""
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,BOOST_ALL_DYN_LINK,_CRT_NONSTDC_NO_WARNINGS,NOMINMAX,WIN32_LEAN_AND_MEAN,_SCL_SECURE_NO_WARNINGS,HAVE_CONFIG_H"
- Optimization="2"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:I386 $(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
- AdditionalDependencies="$(NOINHERIT) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib xolehlp.lib $(QPID_BUILD_ROOT)\src\Release\qpidclient.lib $(QPID_BUILD_ROOT)\src\Release\qpidcommon.lib rpcrt4.lib ws2_32.lib "
- LinkIncremental="2"
- OutputFile="$(OutDir)\Apache.Qpid.Interop.dll"
- AdditionalLibraryDirectories=""$(BOOST_ROOT)\lib""
- KeyFile="$(SolutionDir)\src\wcfnet.snk"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Debug|x64"
- OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="1"
- ManagedExtensions="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="copy ..\AmqpTypes\obj\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule $(PlatformName)\$(ConfigurationName)"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000 /wd4244 /wd4800 /wd4355 /FU $(PlatformName)\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
- Optimization="0"
- AdditionalIncludeDirectories=""$(QPID_BUILD_ROOT)\include";"$(QPID_BUILD_ROOT)\src";..\..\..\..\..\cpp\include;..\..\..\..\..\cpp\src;"$(BOOST_ROOT)""
- PreprocessorDefinitions="WIN32,_WINDOWS,_DEBUG,BOOST_ALL_DYN_LINK,_CRT_NONSTDC_NO_WARNINGS,NOMINMAX,WIN32_LEAN_AND_MEAN,_SCL_SECURE_NO_WARNINGS,HAVE_CONFIG_H"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:x64 /debug $(PlatformName)\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
- AdditionalDependencies="$(NoInherit) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib rpcrt4.lib ws2_32.lib xolehlp.lib $(QPID_BUILD_ROOT)\src\Debug\qpidcommond.lib $(QPID_BUILD_ROOT)\src\Debug\qpidclientd.lib"
- OutputFile="$(OutDir)\Apache.Qpid.Interop.dll"
- LinkIncremental="2"
- AdditionalLibraryDirectories=""$(BOOST_ROOT)\lib""
- GenerateDebugInformation="true"
- AssemblyDebug="1"
- TargetMachine="17"
- KeyFile="$(SolutionDir)\src\wcfnet.snk"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|x64"
- OutputDirectory="$(ProjectDir)$(PlatformName)\$(ConfigurationName)"
- IntermediateDirectory="$(PlatformName)\$(ConfigurationName)"
- ConfigurationType="2"
- CharacterSet="1"
- ManagedExtensions="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- CommandLine="copy ..\AmqpTypes\obj\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule $(PlatformName)\$(ConfigurationName)"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- TargetEnvironment="3"
- />
- <Tool
- Name="VCCLCompilerTool"
- AdditionalOptions=" /Zm1000 /wd4244 /wd4800 /wd4355 /FU $(PlatformName)\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
- AdditionalIncludeDirectories=""$(QPID_BUILD_ROOT)\include";"$(QPID_BUILD_ROOT)\src";..\..\..\..\..\cpp\include;..\..\..\..\..\cpp\src;"$(BOOST_ROOT)""
- PreprocessorDefinitions="WIN32,_WINDOWS,NDEBUG,BOOST_ALL_DYN_LINK,_CRT_NONSTDC_NO_WARNINGS,NOMINMAX,WIN32_LEAN_AND_MEAN,_SCL_SECURE_NO_WARNINGS,HAVE_CONFIG_H"
- InlineFunctionExpansion="2"
- Optimization="2"
- RuntimeLibrary="2"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalOptions=" /STACK:10000000 /machine:x64 $(PlatformName)\$(ConfigurationName)\Apache.Qpid.AmqpTypes.netmodule"
- AdditionalDependencies="$(NoInherit) kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib xolehlp.lib $(QPID_BUILD_ROOT)\src\Release\qpidclient.lib $(QPID_BUILD_ROOT)\src\Release\qpidcommon.lib rpcrt4.lib ws2_32.lib"
- LinkIncremental="2"
- OutputFile="$(OutDir)\Apache.Qpid.Interop.dll"
- AdditionalLibraryDirectories=""$(BOOST_ROOT)\lib""
- KeyFile="$(SolutionDir)\src\wcfnet.snk"
- TargetMachine="17"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- <AssemblyReference
- RelativePath="System.dll"
- AssemblyName="System, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
- MinFrameworkVersion="131072"
- />
- <AssemblyReference
- RelativePath="System.Data.dll"
- AssemblyName="System.Data, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
- MinFrameworkVersion="131072"
- />
- <AssemblyReference
- RelativePath="System.XML.dll"
- AssemblyName="System.Xml, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
- MinFrameworkVersion="131072"
- />
- <AssemblyReference
- RelativePath="System.Runtime.Serialization.dll"
- AssemblyName="System.Runtime.Serialization, Version=3.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL"
- MinFrameworkVersion="196608"
- />
- <AssemblyReference
- RelativePath="System.Transactions.dll"
- AssemblyName="System.Transactions, Version=2.0.0.0, PublicKeyToken=b77a5c561934e089, processorArchitecture=x86"
- MinFrameworkVersion="131072"
- />
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\AmqpConnection.cpp"
- >
- </File>
- <File
- RelativePath=".\AmqpMessage.cpp"
- >
- </File>
- <File
- RelativePath=".\AmqpSession.cpp"
- >
- </File>
- <File
- RelativePath=".\AssemblyInfo.cpp"
- >
- </File>
- <File
- RelativePath=".\CompletionWaiter.cpp"
- >
- </File>
- <File
- RelativePath=".\QpidAddress.cpp"
- >
- </File>
- <File
- RelativePath=".\InputLink.cpp"
- >
- </File>
- <File
- RelativePath=".\MessageBodyStream.cpp"
- >
- </File>
- <File
- RelativePath=".\MessageWaiter.cpp"
- >
- </File>
- <File
- RelativePath=".\OutputLink.cpp"
- >
- </File>
- <File
- RelativePath=".\DtxResourceManager.cpp"
- >
- </File>
- <File
- RelativePath=".\XaTransaction.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\AmqpConnection.h"
- >
- </File>
- <File
- RelativePath=".\AmqpMessage.h"
- >
- </File>
- <File
- RelativePath=".\AmqpSession.h"
- >
- </File>
- <File
- RelativePath=".\CompletionWaiter.h"
- >
- </File>
- <File
- RelativePath=".\QpidAddress.h"
- >
- </File>
- <File
- RelativePath=".\InputLink.h"
- >
- </File>
- <File
- RelativePath=".\MessageBodyStream.h"
- >
- </File>
- <File
- RelativePath=".\MessageWaiter.h"
- >
- </File>
- <File
- RelativePath=".\OutputLink.h"
- >
- </File>
- <File
- RelativePath=".\QpidException.h"
- >
- </File>
- <File
- RelativePath=".\QpidMarshal.h"
- >
- </File>
- <File
- RelativePath=".\DtxResourceManager.h"
- >
- </File>
- <File
- RelativePath=".\XaTransaction.h"
- >
- </File>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/qpid/wcf/src/Apache/Qpid/Interop/MessageBodyStream.cpp b/qpid/wcf/src/Apache/Qpid/Interop/MessageBodyStream.cpp deleted file mode 100644 index f2cb5740d3..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/MessageBodyStream.cpp +++ /dev/null @@ -1,337 +0,0 @@ -/* -* 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. -*/ - -#include <windows.h> -#include <msclr\lock.h> - -#include "qpid/client/AsyncSession.h" -#include "qpid/framing/FrameSet.h" -#include "qpid/framing/AMQFrame.h" - -#include "MessageBodyStream.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Runtime::InteropServices; -using namespace System::Threading; -using namespace msclr; - -using namespace qpid::client; -using namespace qpid::framing; - -// Thefolowing def must match "Frames" private typedef. -// TODO: make "Frames" publicly visible. -typedef qpid::InlineVector<AMQFrame, 4> FrameSetFrames; - -using namespace std; - -static void ThrowIfBadArgs (array<unsigned char>^ buffer, int offset, int count) -{ - if (buffer == nullptr) - throw gcnew ArgumentNullException("buffer"); - - if (offset < 0) - throw gcnew ArgumentOutOfRangeException("offset"); - - if (count < 0) - throw gcnew ArgumentOutOfRangeException("count"); - - if ((offset + count) > buffer->Length) - throw gcnew ArgumentException("offset + count"); -} - - -// Input stream constructor - -MessageBodyStream::MessageBodyStream(FrameSet::shared_ptr *fspp) -{ - isInputStream = true; - frameSetpp = fspp; - fragmentCount = 0; - length = 0; - position = 0; - currentFramep = NULL; - - const std::string *datap; // pointer to the fragment's string variable that holds the content - - for(FrameSetFrames::const_iterator i = (*frameSetpp)->begin(); i != (*frameSetpp)->end(); i++) { - if (i->getBody()->type() == CONTENT_BODY) { - fragmentCount++; - datap = &(i->castBody<AMQContentBody>()->getData()); - length += datap->size(); - } - } - - // fragmentCount can be zero for an empty message - - fragmentIndex = 0; - fragmentPosition = 0; - - if (fragmentCount == 0) { - currentFragment = NULL; - fragmentLength = 0; - } - else if (fragmentCount == 1) { - currentFragment = datap->data(); - fragmentLength = (int) length; - } - else { - fragments = gcnew array<IntPtr>(fragmentCount); - fragmentIndex = 0; - for(FrameSetFrames::const_iterator i = (*frameSetpp)->begin(); i != (*frameSetpp)->end(); i++) { - if (i->getBody()->type() == CONTENT_BODY) { - datap = &(i->castBody<AMQContentBody>()->getData()); - fragments[fragmentIndex++] = (IntPtr) (void *) datap; - } - } - fragmentIndex = 0; - datap = (const std::string *) fragments[0].ToPointer(); - currentFragment = datap->data(); - fragmentLength = datap->size(); - } -} - - -int MessageBodyStream::Read(array<unsigned char>^ buffer, int offset, int count) -{ - if (!isInputStream) - throw gcnew NotSupportedException(); - if (disposed) - throw gcnew ObjectDisposedException("Stream"); - if (count == 0) - return 0; - ThrowIfBadArgs(buffer, offset, count); - - int nRead = 0; - int remaining = count; - - while (nRead < count) { - int fragAvail = fragmentLength - fragmentPosition; - int copyCount = min (fragAvail, remaining); - if (copyCount == 0) { - // no more to read - return nRead; - } - - // copy from native space - IntPtr nativep = (IntPtr) (void *) (currentFragment + fragmentPosition); - Marshal::Copy (nativep, buffer, offset, copyCount); - nRead += copyCount; - remaining -= copyCount; - fragmentPosition += copyCount; - offset += copyCount; - - // advance to next fragment? - if (fragmentPosition == fragmentLength) { - if (++fragmentIndex < fragmentCount) { - const std::string *datap = (const std::string *) fragments[fragmentIndex].ToPointer(); - currentFragment = datap->data(); - fragmentLength = datap->size(); - fragmentPosition = 0; - } - } - } - - return nRead; -} - - -void MessageBodyStream::pushCurrentFrame(bool lastFrame) -{ - // set flags as in SessionImpl::sendContent. - if (currentFramep->getBody()->type() == CONTENT_BODY) { - - if ((fragmentCount == 1) && lastFrame) { - // only one content frame - currentFramep->setFirstSegment(false); - } - else { - currentFramep->setFirstSegment(false); - currentFramep->setLastSegment(true); - if (fragmentCount != 1) { - currentFramep->setFirstFrame(false); - } - if (!lastFrame) { - currentFramep->setLastFrame(false); - } - } - } - else { - // the header frame - currentFramep->setFirstSegment(false); - if (!lastFrame) { - // there will be at least one content frame - currentFramep->setLastSegment(false); - } - } - - // add to frame set. This makes a copy and ref counts the body - (*frameSetpp)->append(*currentFramep); - - delete currentFramep; - - currentFramep = NULL; -} - - -IntPtr MessageBodyStream::GetFrameSet() -{ - if (currentFramep != NULL) { - // No more content. Tidy up the pending (possibly single header) frame. - pushCurrentFrame(true); - } - - if (frameSetpp == NULL) { - return (IntPtr) NULL; - } - - // shared_ptr.get() - return (IntPtr) (void *) (*frameSetpp).get(); -} - -IntPtr MessageBodyStream::GetHeader() -{ - return (IntPtr) headerBodyp; -} - - -// Ouput stream constructor - -MessageBodyStream::MessageBodyStream(int maxFrameSize) -{ - isInputStream = false; - - maxFrameContentSize = maxFrameSize - AMQFrame::frameOverhead(); - SequenceNumber unused; // only meaningful on incoming frames - frameSetpp = new FrameSet::shared_ptr(new FrameSet(unused)); - fragmentCount = 0; - length = 0; - position = 0; - - // header goes first in the outgoing frameset - - boost::intrusive_ptr<AMQBody> headerBody(new AMQHeaderBody); - currentFramep = new AMQFrame(headerBody); - headerBodyp = static_cast<AMQHeaderBody*>(headerBody.get()); - - // mark this header frame as "full" to force the first write to create a new content frame - fragmentPosition = maxFrameContentSize; -} - -void MessageBodyStream::Write(array<unsigned char>^ buffer, int offset, int count) -{ - if (isInputStream) - throw gcnew NotSupportedException(); - if (disposed) - throw gcnew ObjectDisposedException("Stream"); - if (count == 0) - return; - ThrowIfBadArgs(buffer, offset, count); - - if (currentFramep == NULL) { - // GetFrameSet() has been called and we no longer exclusively own the underlying frames. - throw gcnew InvalidOperationException ("Mesage Body output already completed"); - } - - if (count <= 0) - return; - - // keep GC memory movement at bay while copying to native space - pin_ptr<unsigned char> pinnedBuf = &buffer[0]; - - string *datap; - - int remaining = count; - while (remaining > 0) { - if (fragmentPosition == maxFrameContentSize) { - // move to a new frame, but not until ready to add new content. - // zero content is valid, or the final write may exactly fill to maxFrameContentSize - - pushCurrentFrame(false); - - currentFramep = new AMQFrame(AMQContentBody()); - fragmentPosition = 0; - fragmentCount++; - } - - int copyCount = min (remaining, (maxFrameContentSize - fragmentPosition)); - datap = &(currentFramep->castBody<AMQContentBody>()->getData()); - - char *outp = (char *) pinnedBuf + offset; - if (fragmentPosition == 0) { - datap->assign(outp, copyCount); - } - else { - datap->append(outp, copyCount); - } - - position += copyCount; - fragmentPosition += copyCount; - remaining -= copyCount; - offset += copyCount; - } -} - - -void MessageBodyStream::Cleanup() -{ - { - lock l(this); - if (disposed) - return; - - disposed = true; - } - - try {} - finally - { - if (frameSetpp != NULL) { - delete frameSetpp; - frameSetpp = NULL; - } - if (currentFramep != NULL) { - delete currentFramep; - currentFramep = NULL; - } - } -} - -MessageBodyStream::~MessageBodyStream() -{ - Cleanup(); -} - -MessageBodyStream::!MessageBodyStream() -{ - Cleanup(); -} - -void MessageBodyStream::Close() -{ - // Simulate Dispose()... - Cleanup(); - GC::SuppressFinalize(this); -} - - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/MessageBodyStream.h b/qpid/wcf/src/Apache/Qpid/Interop/MessageBodyStream.h deleted file mode 100644 index fa8e3f6bde..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/MessageBodyStream.h +++ /dev/null @@ -1,131 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Runtime::InteropServices; - -using namespace qpid::client; -using namespace qpid::framing; -using namespace std; - - -// This class provides memory streaming of the message body contents -// between native and managed space. To avoid additional memory copies -// in native space, it reads and writes directly to the low level Qpid -// frames. - -public ref class MessageBodyStream : System::IO::Stream -{ -private: - bool isInputStream; - long long length; - long long position; - - // the boost smart pointer that keeps the message body frames in memory - FrameSet::shared_ptr *frameSetpp; - - int fragmentCount; - int fragmentIndex; - const char* currentFragment; - int fragmentPosition; - int fragmentLength; - array<IntPtr>^ fragments; - - int maxFrameContentSize; - AMQFrame* currentFramep; - void* headerBodyp; - bool disposed; - bool finalizing; - void Cleanup(); - -internal: - // incoming message - MessageBodyStream(FrameSet::shared_ptr *fspp); - // outgoing message - MessageBodyStream(int maxFrameSize); - void pushCurrentFrame(bool last); -public: - ~MessageBodyStream(); - !MessageBodyStream(); - virtual void Close() override; - virtual int Read( - [InAttribute] [OutAttribute] array<unsigned char>^ buffer, - int offset, - int count) override; - - virtual void Write( - array<unsigned char>^ buffer, - int offset, - int count) override; - - - IntPtr GetFrameSet(); - IntPtr GetHeader(); - - virtual void Flush() override {} // noop - - - // TODO: see CanSeek below. - virtual long long Seek( - long long offset, - System::IO::SeekOrigin origin) override {throw gcnew System::NotSupportedException(); } - - // TODO: see CanSeek below. - virtual void SetLength( - long long value) override {throw gcnew System::NotSupportedException(); } - - virtual property long long Length { - long long get() override { return length; } - }; - - virtual property long long Position { - long long get() override { return position; } - void set(long long p) override { throw gcnew System::NotSupportedException(); } - }; - - - virtual property bool CanRead { - bool get () override { return isInputStream; } - } - - virtual property bool CanWrite { - bool get () override { return !isInputStream; } - } - - // Note: this class must return true to signal that the Length property works. - // Required by the raw message encoder. - // "If a class derived from Stream does not support seeking, calls to Length, - // SetLength, Position, and Seek throw a NotSupportedException". - - virtual property bool CanSeek { - bool get () override { return true; } - } - - virtual property bool CanTimeout { - bool get () override { return isInputStream; } - } -}; - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/MessageWaiter.cpp b/qpid/wcf/src/Apache/Qpid/Interop/MessageWaiter.cpp deleted file mode 100644 index f7a28b0692..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/MessageWaiter.cpp +++ /dev/null @@ -1,251 +0,0 @@ -/* -* 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. -*/ - -#include <windows.h> -#include <msclr\lock.h> - -#include "qpid/client/AsyncSession.h" -#include "qpid/framing/FrameSet.h" -#include "qpid/client/SubscriptionManager.h" -#include "qpid/client/Connection.h" -#include "qpid/client/Message.h" -#include "qpid/client/MessageListener.h" -#include "qpid/client/Demux.h" -#include "qpid/client/SessionImpl.h" -#include "qpid/client/SessionBase_0_10Access.h" - -#include "MessageBodyStream.h" -#include "AmqpMessage.h" -#include "AmqpSession.h" -#include "InputLink.h" -#include "MessageWaiter.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Threading; -using namespace msclr; - - -MessageWaiter::MessageWaiter(InputLink^ parent, TimeSpan timeSpan, bool consuming, bool async, AsyncCallback ^callback, Object^ state) -{ - this->consuming = consuming; - if (!consuming) { - GC::SuppressFinalize(this); - } - - if (async) { - this->async = true; - this->asyncCallback = callback; - this->state = state; - } - else { - this->assigned = true; - } - this->parent = parent; - this->thisLock = gcnew Object(); - - // do this after the Message Waiter is fully initialized, in case of - // very small timespan - if (timeSpan != TimeSpan::MaxValue) { - this->timer = gcnew Timer(timeoutCallback, this, timeSpan, TimeSpan::FromMilliseconds(-1)); - } -} - -MessageWaiter::~MessageWaiter() -{ - if (message != IntPtr::Zero) { - try{} - finally { - delete message.ToPointer(); - message = IntPtr::Zero; - } - } -} - -MessageWaiter::!MessageWaiter() -{ - this->~MessageWaiter(); -} - - -void MessageWaiter::WaitForCompletion() -{ - if (isCompleted) - return; - - lock l(thisLock); - while (!isCompleted) { - Monitor::Wait(thisLock); - } -} - -void MessageWaiter::Activate() -{ - if (activated) - return; - - lock l(thisLock); - if (!activated) { - activated = true; - Monitor::PulseAll(thisLock); - } -} - - -void MessageWaiter::Run() -{ - lock l(thisLock); - - // wait until Activate(), i.e. our turn in the waiter list or a timeout - while (!activated) { - Monitor::Wait(thisLock); - } - bool haveMessage = false; - bool mustReset = false; - - if (!timedOut) - blocking = true; - - if (blocking) { - l.release(); - - try { - haveMessage = parent->internalWaitForMessage(); - } - catch (System::Exception^ e) { - runException = e; - } - - l.acquire(); - blocking = false; - if (timedOut) { - // TimeoutCallback() called parent->unblockWaiter() - mustReset = true; - // let the timer thread move past critical region - while (processingTimeout) { - Monitor::Wait(thisLock); - } - } - } - - if (timer != nullptr) { - timer->~Timer(); - timer = nullptr; - } - - if (haveMessage) { - timedOut = false; // for the case timeout and message arrival are essentially tied - if (!consuming) { - // just waiting - haveMessage = false; - } - } - - if (haveMessage || mustReset) { - l.release(); - if (haveMessage) { - // hang on to it for when the async caller gets around to retrieving - message = parent->nextLocalMessage(); - } - if (mustReset) { - parent->resetQueue(); - } - l.acquire(); - } - - isCompleted = true; - Monitor::PulseAll(thisLock); - - // do this check and signal while locked - if (asyncWaitHandle != nullptr) - asyncWaitHandle->Set(); - - l.release(); - parent->removeWaiter(this); - - - if (asyncCallback != nullptr) { - // guard against application callback exception - try { - asyncCallback(this); - } - catch (System::Exception^) { - // log it? - } - } - -} - -bool MessageWaiter::AcceptForWork() -{ - lock l(thisLock); - if (!assigned) { - assigned = true; - return true; - } - return false; -} - -void MessageWaiter::TimeoutCallback(Object^ state) -{ - MessageWaiter^ waiter = (MessageWaiter^) state; - if (waiter->isCompleted) - return; - - // make sure parent has finished initializing us before we get going - waiter->parent->sync(); - - lock l(waiter->thisLock); - if (waiter->timer == nullptr) { - // the waiter is in the clean up phase and doesn't need a wakeup - return; - } - - // timedOut, blocking and processingTimeout work as a unit - waiter->timedOut = true; - if (waiter->blocking) { - // let the waiter know that we are busy with an upcoming unblock operation - waiter->processingTimeout = true; - } - - waiter->Activate(); - - if (waiter->processingTimeout) { - // call with lock off - l.release(); - waiter->parent->unblockWaiter(); - - // synchronize with blocked thread - l.acquire(); - waiter->processingTimeout = false; - Monitor::PulseAll(waiter->thisLock); - } - - l.release(); - - // If waiter has no associated thread, we must move it to completion - if (waiter->AcceptForWork()) { - waiter->Run(); // does not block since timedOut == true - } -} - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/MessageWaiter.h b/qpid/wcf/src/Apache/Qpid/Interop/MessageWaiter.h deleted file mode 100644 index 3737430844..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/MessageWaiter.h +++ /dev/null @@ -1,125 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Threading; - -public ref class MessageWaiter : IAsyncResult -{ -private: - // Receive() or WaitForMessage() - bool consuming; - bool consumed; - bool timedOut; - bool async; - // has an owner thread - bool assigned; - // can Run (i.e. earlier MessageWaiters in the queue have completed) - bool activated; - // is making a call to internalWaitForMessage() which (usually) blocks - bool blocking; - // the timeout timer thread is lurking - bool processingTimeout; - // the saved exception from within Run() for async delivery - System::Exception^ runException; - AsyncCallback^ asyncCallback; - Threading::Timer ^timer; - bool isCompleted; - bool completedSynchronously; - Object^ state; - Object^ thisLock; - ManualResetEvent^ asyncWaitHandle; - InputLink^ parent; - static void TimeoutCallback(Object^ state); - static TimerCallback^ timeoutCallback = gcnew TimerCallback(MessageWaiter::TimeoutCallback); - IntPtr message; - !MessageWaiter(); - ~MessageWaiter(); - - internal: - MessageWaiter(InputLink^ parent, TimeSpan timeSpan, bool consuming, bool async, AsyncCallback ^callback, Object^ state); - - void Run(); - bool AcceptForWork(); - void Activate(); - void WaitForCompletion(); - - - property IntPtr Message { - IntPtr get () { - if (!consuming || consumed) - throw gcnew InvalidOperationException("Message property"); - consumed = true; - IntPtr v = message; - message = IntPtr::Zero; - GC::SuppressFinalize(this); - return v; - } - } - - property bool Assigned { - bool get () { return assigned; } - } - - property bool TimedOut { - bool get () { return timedOut; } - } - - property System::Exception^ RunException { - System::Exception^ get() { return runException; } - } - - - public: - - virtual property bool IsCompleted { - bool get () { return isCompleted; } - } - - virtual property bool CompletedSynchronously { - bool get () { return completedSynchronously; } - } - - virtual property WaitHandle^ AsyncWaitHandle { - WaitHandle^ get () { - if (asyncWaitHandle != nullptr) { - return asyncWaitHandle; - } - - msclr::lock l(thisLock); - if (asyncWaitHandle == nullptr) { - asyncWaitHandle = gcnew ManualResetEvent(isCompleted); - } - return asyncWaitHandle; - } - } - - virtual property Object^ AsyncState { - Object^ get () { return state; } - } -}; - -}}} // namespace Apache::Qpid::Interop - diff --git a/qpid/wcf/src/Apache/Qpid/Interop/OutputLink.cpp b/qpid/wcf/src/Apache/Qpid/Interop/OutputLink.cpp deleted file mode 100644 index de7141dadb..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/OutputLink.cpp +++ /dev/null @@ -1,255 +0,0 @@ -/* -* 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. -*/ - -#include <windows.h> -#include <msclr\lock.h> - -#include "qpid/client/AsyncSession.h" -#include "qpid/framing/FrameSet.h" -#include "qpid/client/SubscriptionManager.h" -#include "qpid/client/Connection.h" -#include "qpid/client/Message.h" -#include "qpid/client/MessageListener.h" - - -#include "AmqpSession.h" -#include "AmqpMessage.h" -#include "OutputLink.h" -#include "QpidMarshal.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Runtime::InteropServices; -using namespace System::Threading; -using namespace msclr; - -using namespace qpid::client; -using namespace std; - -using namespace Apache::Qpid::AmqpTypes; - - -OutputLink::OutputLink(AmqpSession^ session, String^ address) : - amqpSession(session), - disposed(false), - maxFrameSize(session->Connection->MaxFrameSize), - finalizing(false) -{ - qpidAddress = QpidAddress::CreateAddress(address, false); - qpidAddress->ResolveLink(session); -} - -void OutputLink::Cleanup() -{ - { - lock l(this); - if (disposed) - return; - - disposed = true; - } - - // process any pending queue delete - qpidAddress->CleanupLink(amqpSession); - amqpSession->NotifyClosed(); -} - -OutputLink::~OutputLink() -{ - Cleanup(); -} - -OutputLink::!OutputLink() -{ - Cleanup(); -} - -void OutputLink::Close() -{ - // Simulate Dispose()... - Cleanup(); - GC::SuppressFinalize(this); -} - - -AmqpMessage^ OutputLink::CreateMessage() -{ - MessageBodyStream ^mbody = gcnew MessageBodyStream(maxFrameSize); - AmqpMessage ^amqpm = gcnew AmqpMessage(mbody); - return amqpm; -} - - -void OutputLink::ManagedToNative(AmqpMessage^ m) -{ - MessageBodyStream^ messageBodyStream = (MessageBodyStream^ ) m->BodyStream; - - AmqpProperties^ mprops = m->Properties; - - if (mprops != nullptr) { - AMQHeaderBody* bodyp = (AMQHeaderBody*) messageBodyStream->GetHeader().ToPointer(); - - if (mprops->HasDeliveryProperties) { - DeliveryProperties* deliveryPropertiesp = bodyp->get<DeliveryProperties>(true); - - if (mprops->RoutingKey != nullptr) { - deliveryPropertiesp->setRoutingKey(QpidMarshal::ToNative(mprops->RoutingKey)); - } - - if (mprops->Durable) { - deliveryPropertiesp->setDeliveryMode(qpid::framing::PERSISTENT); - } - - if (mprops->TimeToLive.HasValue) { - long long ttl = mprops->TimeToLive.Value.Ticks; - bool was_positive = (ttl > 0); - if (ttl < 0) - ttl = 0; - ttl = ttl / TimeSpan::TicksPerMillisecond; - if ((ttl == 0) && was_positive) - ttl = 1; - deliveryPropertiesp->setTtl(ttl); - } - } - - if (mprops->HasMessageProperties) { - qpid::framing::MessageProperties* messagePropertiesp = - bodyp->get<qpid::framing::MessageProperties>(true); - - String^ replyToExchange = mprops->ReplyToExchange; - String^ replyToRoutingKey = mprops->ReplyToRoutingKey; - if ((replyToExchange != nullptr) || (replyToRoutingKey != nullptr)) { - qpid::framing::ReplyTo nReplyTo; - if (replyToExchange != nullptr) { - nReplyTo.setExchange(QpidMarshal::ToNative(replyToExchange)); - } - if (replyToRoutingKey != nullptr) { - nReplyTo.setRoutingKey(QpidMarshal::ToNative(replyToRoutingKey)); - } - messagePropertiesp->setReplyTo(nReplyTo); - } - - // TODO: properly split 1.0 style to 0-10 content type + encoding - - String^ contentType = mprops->ContentType; - if (contentType != nullptr) { - String^ type = nullptr; - String^ enc = nullptr; - int idx = contentType->IndexOf(';'); - if (idx == -1) { - type = contentType; - } - else { - type = contentType->Substring(0, idx); - contentType = contentType->Substring(idx + 1); - idx = contentType->IndexOf('='); - if (idx != -1) { - enc = contentType->Substring(idx + 1); - enc = enc->Trim(); - } - } - if (!String::IsNullOrEmpty(type)) { - messagePropertiesp->setContentType(QpidMarshal::ToNative(type)); - } - if (!String::IsNullOrEmpty(enc)) { - messagePropertiesp->setContentEncoding(QpidMarshal::ToNative(enc)); - } - } - - - array<unsigned char>^ mbytes = mprops->CorrelationId; - if (mbytes != nullptr) { - pin_ptr<unsigned char> pinnedBuf = &mbytes[0]; - std::string s((char *) pinnedBuf, mbytes->Length); - messagePropertiesp->setCorrelationId(s); - } - - mbytes = mprops->UserId; - if (mbytes != nullptr) { - pin_ptr<unsigned char> pinnedBuf = &mbytes[0]; - std::string s((char *) pinnedBuf, mbytes->Length); - messagePropertiesp->setUserId(s); - } - - if (mprops->HasMappedProperties) { - qpid::framing::FieldTable fieldTable; - // TODO: add support for abitrary AMQP types - for each (Collections::Generic::KeyValuePair<System::String^, AmqpType^> kvp in mprops->PropertyMap) { - Type^ type = kvp.Value->GetType(); - if (type == AmqpInt::typeid) { - fieldTable.setInt(QpidMarshal::ToNative(kvp.Key), - ((AmqpInt ^) kvp.Value)->Value); - } - else if (type == AmqpString::typeid) { - AmqpString^ str = (AmqpString ^) kvp.Value; - // For now, FieldTable supports a single string type - fieldTable.setString(QpidMarshal::ToNative(kvp.Key), QpidMarshal::ToNative(str->Value)); - } - } - - messagePropertiesp->setApplicationHeaders(fieldTable); - } - } - } -} - - - -void OutputLink::Send(AmqpMessage^ amqpMessage, TimeSpan timeout) -{ - // copy properties from managed space to the native counterparts - ManagedToNative(amqpMessage); - - MessageBodyStream^ messageBodyStream = (MessageBodyStream^ ) amqpMessage->BodyStream; - CompletionWaiter^ waiter = amqpSession->SendMessage(qpidAddress->LinkName, messageBodyStream, - timeout, false, nullptr, nullptr); - - if (waiter != nullptr) { - waiter->WaitForCompletion(); - if (waiter->TimedOut) { - throw gcnew TimeoutException("Receive"); - } - } - // else: SendMessage() has already waited for the Completion - -} - -IAsyncResult^ OutputLink::BeginSend(AmqpMessage^ amqpMessage, TimeSpan timeout, AsyncCallback^ callback, Object^ state) -{ - ManagedToNative(amqpMessage); - - MessageBodyStream^ messageBodyStream = (MessageBodyStream^ ) amqpMessage->BodyStream; - CompletionWaiter^ waiter = amqpSession->SendMessage(qpidAddress->LinkName, messageBodyStream, timeout, true, callback, state); - return waiter; -} - -void OutputLink::EndSend(IAsyncResult^ result) -{ - CompletionWaiter^ waiter = (CompletionWaiter ^) result; - waiter->WaitForCompletion(); - if (waiter->TimedOut) { - throw gcnew TimeoutException("Receive"); - } -} - - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/OutputLink.h b/qpid/wcf/src/Apache/Qpid/Interop/OutputLink.h deleted file mode 100644 index e30d1cc79f..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/OutputLink.h +++ /dev/null @@ -1,75 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -#include "QpidAddress.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Runtime::InteropServices; - -using namespace qpid::client; -using namespace std; - - -public ref class OutputLink -{ -private: - AmqpSession^ amqpSession; - QpidAddress^ qpidAddress; - bool disposed; - bool finalizing; - void Cleanup(); - AmqpTypes::AmqpProperties^ defaultProperties; - void ManagedToNative(AmqpMessage^ m); - int maxFrameSize; - -internal: - OutputLink(AmqpSession^ session, String^ defaultQueue); - -public: - ~OutputLink(); - !OutputLink(); - void Close(); - AmqpMessage^ CreateMessage(); - void Send(AmqpMessage^ m, TimeSpan timeout); - IAsyncResult^ BeginSend(AmqpMessage^ amqpMessage, TimeSpan timeout, AsyncCallback^ callback, Object^ state); - void EndSend(IAsyncResult^ result); - - property AmqpTypes::AmqpProperties^ DefaultProperties { - AmqpTypes::AmqpProperties^ get () { return defaultProperties; } - void set(AmqpTypes::AmqpProperties^ p) { defaultProperties = p; } - } - - property String^ DefaultSubject { - String^ get() { return (qpidAddress == nullptr) ? nullptr : qpidAddress->RoutingKey; } - } - - property String^ QpidSubject { - String^ get() { return (qpidAddress == nullptr) ? nullptr : qpidAddress->Subject; } - } - -}; - - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/QpidAddress.cpp b/qpid/wcf/src/Apache/Qpid/Interop/QpidAddress.cpp deleted file mode 100644 index bfae1ab313..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/QpidAddress.cpp +++ /dev/null @@ -1,304 +0,0 @@ -/* -* 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. -*/ - - -/* - * This program parses strings of the form "node/subject;{options}" as - * used in the Qpid messaging API. It provides basic wiring - * capabilities to create/delete temporary queues (to topic - * subsciptions) and unbound "point and shoot" queues. - */ - - -#include <windows.h> -#include <msclr\lock.h> -#include <oletx2xa.h> - -#include "qpid/client/AsyncSession.h" -#include "qpid/client/SubscriptionManager.h" -#include "qpid/client/Connection.h" -#include "qpid/client/SessionImpl.h" -#include "qpid/client/SessionBase_0_10Access.h" -#include "qpid/client/Message.h" -#include "qpid/framing/MessageTransferBody.h" -#include "qpid/client/Future.h" - -#include "AmqpConnection.h" -#include "AmqpSession.h" -#include "AmqpMessage.h" -#include "MessageBodyStream.h" -#include "InputLink.h" -#include "OutputLink.h" -#include "QpidMarshal.h" -#include "QpidException.h" -#include "QpidAddress.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Runtime::InteropServices; -using namespace msclr; - -using namespace qpid::client; -using namespace std; - -QpidAddress::QpidAddress(String^ s, bool isInput) { - address = s; - nodeName = s; - isInputChannel = isInput; - isQueue = true; - - if (address->StartsWith("//")) { - // special case old style address to default exchange, - // no options, output only - if ((s->IndexOf(';') != -1) || isInputChannel) - throw gcnew ArgumentException("Invalid 0-10 address: " + address); - nodeName = nodeName->Substring(2); - return; - } - - String^ options = nullptr; - int pos = s->IndexOf(';'); - if (pos != -1) { - options = s->Substring(pos + 1); - nodeName = s->Substring(0, pos); - - if (options->Length > 0) { - if (!options->StartsWith("{") || !options->EndsWith("}")) - throw gcnew ArgumentException("Invalid address: " + address); - options = options->Substring(1, options->Length - 2); - array<String^>^ subOpts = options->Split(String(",: ").ToCharArray(), StringSplitOptions::RemoveEmptyEntries); - - if ((subOpts->Length % 2) != 0) - throw gcnew ArgumentException("Bad address (options): " + address); - - for (int i=0; i < subOpts->Length; i += 2) { - String^ opt = subOpts[i]; - String^ optArg = subOpts[i+1]; - if (opt->Equals("create")) { - creating = PolicyApplies(optArg); - } - else if (opt->Equals("delete")) { - deleting = PolicyApplies(optArg); - } - else if (opt->Equals("mode")) { - if (optArg->Equals("browse")) { - browsing = isInputChannel; - } - else if (!optArg->Equals("consume")) { - throw gcnew ArgumentException("Invalid browsing option: " + optArg); - } - } - else if (opt->Equals("assert") || opt->Equals("node")) { - throw gcnew ArgumentException("Unsupported address option: " + opt); - } - else { - throw gcnew ArgumentException("Bad address option: " + opt); - } - } - } - else - options = nullptr; - } - - pos = nodeName->IndexOf('/'); - if (pos != -1) { - subject = nodeName->Substring(pos + 1); - if (String::IsNullOrEmpty(subject)) - subject = nullptr; - nodeName = nodeName->Substring(0, pos); - } -} - - -QpidAddress^ QpidAddress::CreateAddress(String^ s, bool isInput) { - QpidAddress^ addr = gcnew QpidAddress(s, isInput); - return addr; -} - - -void QpidAddress::ResolveLink(AmqpSession^ amqpSession) { - - AsyncSession* asyncSessionp = (AsyncSession *) amqpSession->BorrowNativeSession().ToPointer(); - if (asyncSessionp == NULL) - throw gcnew ObjectDisposedException("session"); - - deleteName = nullptr; - isQueue = true; - - try { - Session session = sync(*asyncSessionp); - std::string n_name = QpidMarshal::ToNative(nodeName); - ExchangeBoundResult result = session.exchangeBound(arg::exchange=n_name, arg::queue=n_name); - - bool queueFound = !result.getQueueNotFound(); - bool exchangeFound = !result.getExchangeNotFound(); - - if (isInputChannel) { - - if (queueFound) { - linkName = nodeName; - if (deleting) - deleteName = nodeName; - } - else if (exchangeFound) { - isQueue = false; - String^ tmpkey = nullptr; - String^ tmpname = nodeName + "_" + Guid::NewGuid().ToString(); - bool haveSubject = !String::IsNullOrEmpty(subject); - FieldTable bindArgs; - - std::string exchangeType = session.exchangeQuery(n_name).getType(); - if (exchangeType == "topic") { - tmpkey = haveSubject ? subject : "#"; - } - else if (exchangeType == "fanout") { - tmpkey = tmpname; - } - else if (exchangeType == "headers") { - tmpkey = haveSubject ? subject : "match-all"; - if (haveSubject) - bindArgs.setString("qpid.subject", QpidMarshal::ToNative(subject)); - bindArgs.setString("x-match", "all"); - } - else if (exchangeType == "xml") { - tmpkey = haveSubject ? subject : ""; - if (haveSubject) { - String^ v = "declare variable $qpid.subject external; $qpid.subject = '" + - subject + "'"; - bindArgs.setString("xquery", QpidMarshal::ToNative(v)); - } - else - bindArgs.setString("xquery", "true()"); - } - else { - tmpkey = haveSubject ? subject : ""; - } - - std::string qn = QpidMarshal::ToNative(tmpname); - session.queueDeclare(arg::queue=qn, arg::autoDelete=true, arg::exclusive=true); - bool success = false; - try { - session.exchangeBind(arg::exchange=n_name, arg::queue=qn, - arg::bindingKey=QpidMarshal::ToNative(tmpkey), - arg::arguments=bindArgs); - bindKey = tmpkey; // remember for later cleanup - success = true; - } - finally { - if (!success) - session.queueDelete(arg::queue=qn); - } - linkName = tmpname; - deleteName = tmpname; - deleting = true; - } - else if (creating) { - // only create "point and shoot" queues for now - session.queueDeclare(arg::queue=QpidMarshal::ToNative(nodeName)); - // leave unbound - - linkName = nodeName; - - if (deleting) - deleteName = nodeName; - } - else { - throw gcnew ArgumentException("AMQP broker node not found: " + nodeName); - } - } - else { - // Output channel - - bool oldStyleUri = address->StartsWith("//"); - - if (queueFound) { - linkName = ""; // default exchange for point and shoot - routingKey = nodeName; - if (deleting) - deleteName = nodeName; - } - else if (exchangeFound && !oldStyleUri) { - isQueue = false; - linkName = nodeName; - routingKey = subject; - } - else if (creating) { - // only create "point and shoot" queues for now - session.queueDeclare(arg::queue=QpidMarshal::ToNative(nodeName)); - // leave unbound - linkName = ""; - routingKey = nodeName; - if (deleting) - deleteName = nodeName; - } - else { - throw gcnew ArgumentException("AMQP broker node not found: " + nodeName); - } - } - } - finally { - amqpSession->ReturnNativeSession(); - } -} - -void QpidAddress::CleanupLink(AmqpSession^ amqpSession) { - if (deleteName == nullptr) - return; - - AsyncSession* asyncSessionp = (AsyncSession *) amqpSession->BorrowNativeSession().ToPointer(); - if (asyncSessionp == NULL) { - // TODO: log it: can't undo tear down actions - return; - } - - try { - Session session = sync(*asyncSessionp); - std::string q = QpidMarshal::ToNative(deleteName); - if (isInputChannel && !isQueue) { - // undo the temp wiring to the topic - session.exchangeUnbind(arg::exchange=QpidMarshal::ToNative(nodeName), arg::queue=q, - arg::bindingKey=QpidMarshal::ToNative(bindKey)); - } - session.queueDelete(q); - } - catch (Exception^ e) { - // TODO: log it - } - finally { - amqpSession->ReturnNativeSession(); - } -} - -bool QpidAddress::PolicyApplies(String^ mode) { - if (mode->Equals("always")) - return true; - if (mode->Equals("sender")) - return !isInputChannel; - if (mode->Equals("receiver")) - return isInputChannel; - if (mode->Equals("never")) - return false; - - throw gcnew ArgumentException(String::Format("Bad address option {0} for {1}", mode, address)); -} - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/QpidAddress.h b/qpid/wcf/src/Apache/Qpid/Interop/QpidAddress.h deleted file mode 100644 index d24317c2aa..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/QpidAddress.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -#include "MessageWaiter.h" - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Threading; -using namespace System::Runtime::InteropServices; - -using namespace qpid::client; -using namespace std; - - -public ref class QpidAddress -{ -private: - QpidAddress(String^ address, bool isInput); - - // the original Qpid messaging address string, with WCF uri sematics removed, and URL decoded - String^ address; - - String^ nodeName; - // "qpid.subject" - String^ subject; - // 0-10 routing key (Output channels only) - String^ routingKey; - - String^ linkName; - String^ deleteName; - String^ bindKey; - - // node type: queue/topic - bool isQueue; - - // direction - bool isInputChannel; - - bool creating; - bool deleting; - bool browsing; - - bool PolicyApplies(String^ mode); - -internal: - static QpidAddress^ CreateAddress(String ^s, bool isInput); - void ResolveLink(AmqpSession^ amqpSession); - void CleanupLink(AmqpSession^ amqpSession); - - property String^ LinkName { - String^ get () { return linkName; } - } - - property String^ Subject { - String^ get () { return subject; } - } - - property String^ RoutingKey { - String^ get () { return routingKey; } - } - - property bool Browsing { - bool get () { return browsing; } - } - -}; - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/QpidException.h b/qpid/wcf/src/Apache/Qpid/Interop/QpidException.h deleted file mode 100644 index 91677a5e73..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/QpidException.h +++ /dev/null @@ -1,37 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; - -public ref class QpidException : System::Exception -{ - public: - - QpidException() : System::Exception() {} - QpidException(String^ estring) : System::Exception(estring) {} - -}; - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/QpidMarshal.h b/qpid/wcf/src/Apache/Qpid/Interop/QpidMarshal.h deleted file mode 100644 index 3e22af7b39..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/QpidMarshal.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -namespace Apache { -namespace Qpid { -namespace Interop { - -using namespace System; -using namespace System::Text; - - -// Helper functions for marshaling. - -private ref class QpidMarshal -{ - public: - - // marshal_as<T> not available in all Visual Studio editions. - - static std::string ToNative (System::String^ managed) { - if (managed->Length == 0) { - return std::string(); - } - array<unsigned char>^ mbytes = Encoding::UTF8->GetBytes(managed); - if (mbytes->Length == 0) { - return std::string(); - } - - pin_ptr<unsigned char> pinnedBuf = &mbytes[0]; - std::string native((char *) pinnedBuf, mbytes->Length); - return native; - } -}; - -}}} // namespace Apache::Qpid::Interop diff --git a/qpid/wcf/src/Apache/Qpid/Interop/XaTransaction.cpp b/qpid/wcf/src/Apache/Qpid/Interop/XaTransaction.cpp deleted file mode 100644 index 23743316ff..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/XaTransaction.cpp +++ /dev/null @@ -1,525 +0,0 @@ -/*
-* 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.
-*/
-
-#include <windows.h>
-#include <msclr\lock.h>
-#include <transact.h>
-#include <xolehlp.h>
-#include <txdtc.h>
-#include <oletx2xa.h>
-#include <iostream>
-#include <fstream>
-
-#include "qpid/client/AsyncSession.h"
-#include "qpid/client/SubscriptionManager.h"
-#include "qpid/client/Connection.h"
-#include "qpid/framing/FrameSet.h"
-#include "qpid/framing/Xid.h"
-
-#include "QpidException.h"
-#include "AmqpConnection.h"
-#include "AmqpSession.h"
-#include "DtxResourceManager.h"
-#include "XaTransaction.h"
-
-namespace Apache {
-namespace Qpid {
-namespace Interop {
-
-using namespace System;
-using namespace System::Runtime::InteropServices;
-using namespace System::Transactions;
-using namespace msclr;
-
-using namespace qpid::framing::dtx;
-
-// ------------------------------------------------------------------------
-// Start of a pure native code section
-#pragma unmanaged
-// ------------------------------------------------------------------------
-
-// This is the native COM object the DTC expects to talk to for coordination.
-// There is exactly one native instance of this for each managed XaTransaction object.
-
-
-class DtcCallbackHandler : public ITransactionResourceAsync
-{
-private:
- long useCount;
- DtcCallbackFp managedCallback;
-public:
- ITransactionEnlistmentAsync *txHandle;
- DtcCallbackHandler(DtcCallbackFp cbp) : managedCallback(cbp), useCount(0) {}
- ~DtcCallbackHandler() {}
- virtual HRESULT __stdcall PrepareRequest(BOOL unused, DWORD grfrm, BOOL unused2, BOOL singlePhase);
- virtual HRESULT __stdcall CommitRequest(DWORD grfrm, XACTUOW *unused);
- virtual HRESULT __stdcall AbortRequest(BOID *unused, BOOL unused2, XACTUOW *unused3);
-
- virtual HRESULT __stdcall TMDown();
- virtual HRESULT __stdcall DtcCallbackHandler::QueryInterface (REFIID riid, void **ppvObject);
- virtual ULONG __stdcall DtcCallbackHandler::AddRef();
- virtual ULONG __stdcall DtcCallbackHandler::Release();
- void __stdcall AbortRequestDone();
-};
-
-
-HRESULT DtcCallbackHandler::PrepareRequest(BOOL unused, DWORD grfrm, BOOL unused2, BOOL singlePhase)
-{
- if (singlePhase) {
- return managedCallback(DTC_SINGLE_PHASE) ? S_OK : E_FAIL;
- }
-
- return managedCallback(DTC_PREPARE) ? S_OK : E_FAIL;
-}
-
-
-HRESULT DtcCallbackHandler::CommitRequest(DWORD grfrm, XACTUOW *unused)
-{
- return managedCallback(DTC_COMMIT) ? S_OK : E_FAIL;
-}
-
-HRESULT DtcCallbackHandler::AbortRequest(BOID *unused, BOOL unused2, XACTUOW *unused3)
-{
- return managedCallback(DTC_ABORT) ? S_OK : E_FAIL;
-}
-
-
-HRESULT DtcCallbackHandler::TMDown()
-{
- return managedCallback(DTC_TMDOWN) ? S_OK : E_FAIL;
-}
-
-
-HRESULT DtcCallbackHandler::QueryInterface (REFIID riid, void **ppvObject)
-{
- *ppvObject = NULL;
-
- if ((riid == IID_IUnknown) || (riid == IID_IResourceManagerSink))
- *ppvObject = this;
- else
- return ResultFromScode(E_NOINTERFACE);
-
- this->AddRef();
- return S_OK;
-}
-
-
-ULONG DtcCallbackHandler::AddRef()
-{
- return InterlockedIncrement(&useCount);
-}
-
-
-ULONG DtcCallbackHandler::Release()
-{
- long uc = InterlockedDecrement(&useCount);
-
- if (uc)
- return uc;
-
- delete this;
- return 0;
-}
-
-
-// ------------------------------------------------------------------------
-// End of pure native code section
-#pragma managed
-// ------------------------------------------------------------------------
-
-#ifdef QPID_RECOVERY_TEST_HOOK
-void XaTransaction::ForceRecovery() {
- debugFailMode = true;
-}
-#endif
-
-// ------------------------------------------------------------------------
-// ------------------------------------------------------------------------
-
-
-XaTransaction::XaTransaction(Transaction^ t, IDtcToXaHelperSinglePipe *xaHelperp, DWORD rmCookie, DtxResourceManager^ rm) {
- bool success = false;
- xidp = NULL;
- commandCompletionp = NULL;
- firstDtxStartCompletionp = NULL;
- nativeHandler = NULL;
- resourceManager = rm;
- controlSession = rm->DtxControlSession;
- active = true;
- preparing = false;
- systemTransaction = t;
- IntPtr comTxp = IntPtr::Zero;
- completionHandle = gcnew ManualResetEvent(false);
-
- try {
- enlistedSessions = gcnew Collections::Generic::List<AmqpSession^>();
-
- // take a System.Transactions.Transaction and obtain
- // the corresponding DTC COM object.
- IDtcTransaction^ dtcTransaction = TransactionInterop::GetDtcTransaction(t);
- comTxp = Marshal::GetIUnknownForObject(dtcTransaction);
- XID winXid;
- HRESULT hr = xaHelperp->ConvertTridToXID((DWORD *)comTxp.ToPointer(), rmCookie, &winXid);
- if (hr != S_OK)
- throw gcnew QpidException("get XA XID");
-
- // Convert the X/Open format to the internal Qpid format
- xidp = new qpid::framing::Xid();
- xidp->setFormat((uint32_t) winXid.formatID);
- int bqualPos = 0;
- if (winXid.gtrid_length > 0) {
- xidp->setGlobalId(std::string(winXid.data, winXid.gtrid_length));
- bqualPos = winXid.gtrid_length;
- }
- if (winXid.bqual_length > 0) {
- xidp->setBranchId(std::string(winXid.data + bqualPos, winXid.bqual_length));
- }
-
- // create the callback chain: DTC proxy -> DtcCallbackHandler -> this
- inboundDelegate = gcnew DtcCallbackDelegate(this, &XaTransaction::DtcCallback);
- IntPtr ip = Marshal::GetFunctionPointerForDelegate(inboundDelegate);
- nativeHandler = new DtcCallbackHandler(static_cast<DtcCallbackFp>(ip.ToPointer()));
- // add myself for later smart pointer destruction
- nativeHandler->AddRef();
-
- hr = xaHelperp->EnlistWithRM(rmCookie, (ITransaction *)comTxp.ToPointer(), nativeHandler, &(nativeHandler->txHandle));
-
- if (hr != S_OK)
- throw gcnew QpidException("Enlist");
-
- success = true;
- }
- finally {
- if (!success)
- Cleanup();
- if (comTxp != IntPtr::Zero)
- ((IUnknown *) comTxp.ToPointer())->Release();
- }
-}
-
-
-void XaTransaction::Cleanup() {
- if (firstDtxStartCompletionp != NULL) {
- try {
- firstEnlistedSession->ReleaseCompletion((IntPtr) firstDtxStartCompletionp);
- }
- catch (...) {
- // TODO: log it?
- }
-
- firstDtxStartCompletionp = NULL;
- }
-
- if (nativeHandler != NULL) {
- nativeHandler->Release();
- nativeHandler = NULL;
- }
- if (xidp != NULL) {
- delete xidp;
- xidp = NULL;
- }
-}
-
-
-XaTransaction^ XaTransaction::Enlist (AmqpSession ^session) {
- lock l(enlistedSessions);
- if (!active)
- throw gcnew QpidException("transaction enlistment internal error");
- if (!enlistedSessions->Contains(session)) {
- enlistedSessions->Add(session);
- if (firstEnlistedSession == nullptr) {
- firstEnlistedSession = session;
- IntPtr intptr = session->DtxStart((IntPtr) xidp, false, false);
- firstDtxStartCompletionp = (TypedResult<qpid::framing::XaResult> *) intptr.ToPointer();
- }
- else {
- // the broker must see the dtxStart as a join operation, and it must arrive
- // at the broker after the first dtx start
- if (firstDtxStartCompletionp != NULL)
- firstDtxStartCompletionp->wait();
- session->DtxStart((IntPtr) xidp, true, false);
- }
- }
- else {
- // already started once, so resume is true
- session->DtxStart((IntPtr) xidp, false, true);
- }
- return this;
-}
-
-
-void XaTransaction::SessionClosing(AmqpSession^ session) {
- lock l(enlistedSessions);
- if (!enlistedSessions->Contains(session))
- return;
-
- enlistedSessions->Remove(session);
- if (!active) {
- // Phase0Flush already done on all sessions
- l.release();
- return;
- }
-
- IntPtr completion = session->BeginPhase0Flush(this);
- session->EndPhase0Flush(this, completion);
-
- if (session == firstEnlistedSession) {
- // if we just completed the dtxEnd, we know the dtxStart completed before that
- if (firstDtxStartCompletionp != NULL) {
- firstEnlistedSession->ReleaseCompletion((IntPtr) firstDtxStartCompletionp);
- firstDtxStartCompletionp = NULL;
- }
- }
-}
-
-
-void XaTransaction::Phase0Flush() {
- // let each session delimit their transactional work with an AMQP dtx.end protocol frame
- lock l(enlistedSessions);
- if (!active)
- return;
-
- active = false; // no more enlistments
- int scount = enlistedSessions->Count;
-
- if (scount > 0) {
- array<IntPtr> ^completions = gcnew array<IntPtr>(scount);
- for (int i = 0; i < scount; i++) {
-
- // TODO: skip phase0 flush for rollback case
-
- completions[i] = enlistedSessions[i]->BeginPhase0Flush(this);
- }
-
- for (int i = 0; i < scount; i++) {
- // without each session.sync(), session commands are queued up in the right order,
- // but on their separate outbound channels, and destined for receipt at separate Broker inbound
- // channels. It is not clear how to be sure Phase 0 dtx.End is processed in the
- // correct order before commit on the broker without the sync.
- enlistedSessions[i]->EndPhase0Flush(this, completions[i]);
- }
- }
-
- // since all dtxEnds have completed, we know all starts have too
- if (firstDtxStartCompletionp != NULL) {
- try {
- firstEnlistedSession->ReleaseCompletion((IntPtr) firstDtxStartCompletionp);
- }
- catch (...) {
- // TODO: log it?
- }
-
- firstDtxStartCompletionp = NULL;
- }
-}
-
-
-bool XaTransaction::DtcCallback (DtcCallbackType callback) {
- // called by the DTC proxy thread. Be brief and don't block (but Phase0Flush?)
-
- if (AppDomain::CurrentDomain->IsFinalizingForUnload())
- return false;
-
- IntPtr intptr = IntPtr::Zero;
- currentCommand = callback;
-
- try {
- switch (callback) {
- case DTC_PREPARE:
- Phase0Flush();
- try {
- intptr = controlSession->DtxPrepare((IntPtr) xidp);
- preparing = true;
- resourceManager->IncrementDoubt();
- }
- catch (System::Exception^ ) {
- // intptr remains nullptr
- }
- commandCompletionp = (TypedResult<qpid::framing::XaResult> *) intptr.ToPointer();
- ThreadPool::QueueUserWorkItem(gcnew WaitCallback(this, &XaTransaction::AsyncCompleter));
- break;
-
- case DTC_COMMIT:
-#ifdef QPID_RECOVERY_TEST_HOOK
- if (debugFailMode){ return; }
-#endif
- // no phase 0 required. always preceded by a prepare
- try {
- intptr = controlSession->DtxCommit((IntPtr) xidp, false);
- }
- catch (System::Exception^ ) {
- // intptr remains nullptr
- }
- commandCompletionp = (TypedResult<qpid::framing::XaResult> *) intptr.ToPointer();
- ThreadPool::QueueUserWorkItem(gcnew WaitCallback(this, &XaTransaction::AsyncCompleter));
- break;
-
- case DTC_ABORT:
- Phase0Flush();
-#ifdef QPID_RECOVERY_TEST_HOOK
- if (debugFailMode){ return; }
-#endif
- try {
- intptr = controlSession->DtxRollback((IntPtr) xidp);
- }
- catch (System::Exception^ ) {
- // intptr remains nullptr
- }
- commandCompletionp = (TypedResult<qpid::framing::XaResult> *) intptr.ToPointer();
- ThreadPool::QueueUserWorkItem(gcnew WaitCallback(this, &XaTransaction::AsyncCompleter));
- break;
-
- case DTC_SINGLE_PHASE:
- Phase0Flush();
- try {
- intptr = controlSession->DtxCommit((IntPtr) xidp, true);
- }
- catch (System::Exception^ ) {
- // intptr remains nullptr
- }
- commandCompletionp = (TypedResult<qpid::framing::XaResult> *) intptr.ToPointer();
- ThreadPool::QueueUserWorkItem(gcnew WaitCallback(this, &XaTransaction::AsyncCompleter));
- break;
-
- case DTC_TMDOWN:
- commandCompletionp = NULL;
- ThreadPool::QueueUserWorkItem(gcnew WaitCallback(this, &XaTransaction::AsyncCompleter));
- break;
- }
- return true;
- }
- catch (System::Exception^ e) {
- // TODO: log it
- Console::WriteLine("Unexpected DtcCallback exception: {0}", e->ToString());
- }
- catch (...) {
- // TODO: log it
- }
- return false;
-}
-
-
-// this handles the case where the application regains control for
-// a new transaction before we are notified (abort/rollback
-// optimization in DTC).
-
-void XaTransaction::NotifyPhase0() {
- if (active)
- Phase0Flush();
-}
-
-
-void XaTransaction::AsyncCompleter(Object ^unused) {
- bool success = false;
-
- if (commandCompletionp != NULL) {
- try {
- // waits for the AMQP broker's response and returns the decoded content
- XaResult& xaResult = commandCompletionp->get();
- if (xaResult.hasStatus()) {
- if (xaResult.getStatus() == XaStatus::XA_STATUS_XA_OK) {
- success = true;
- }
- }
- }
- catch (...) {
- // TODO: log it?
- }
- try {
- controlSession->ReleaseCompletion((IntPtr) commandCompletionp);
- }
- catch (...) {
- // TODO: log it?
- }
-
- commandCompletionp = NULL;
- }
-
- ITransactionEnlistmentAsync *dtcTxHandle = nativeHandler->txHandle;
-
- HRESULT hr = success ? S_OK : E_FAIL;
-
- switch (currentCommand) {
- case DTC_PREPARE:
- dtcTxHandle->PrepareRequestDone(hr, NULL, NULL);
- break;
-
- case DTC_COMMIT:
- dtcTxHandle->CommitRequestDone(hr);
- if (success)
- resourceManager->DecrementDoubt();
- Complete();
- break;
-
- case DTC_ABORT:
- dtcTxHandle->AbortRequestDone(hr);
- if (success) {
- if (preparing) {
- preparing = false;
- resourceManager->DecrementDoubt();
- }
- }
- Complete();
- break;
-
- case DTC_SINGLE_PHASE:
- if (success)
- hr = XACT_S_SINGLEPHASE;
- dtcTxHandle->PrepareRequestDone(hr, NULL, NULL);
- Complete();
- break;
-
- case DTC_TMDOWN:
- // Stop the RM from accepting new enlistments
- resourceManager->TmDown();
- Complete();
- break;
- }
-}
-
-
-void XaTransaction::Complete() {
- Cleanup();
- resourceManager->Complete(systemTransaction);
- completionHandle->Set();
-}
-
-
-void XaTransaction::WaitForCompletion() {
- completionHandle->WaitOne();
-}
-
-
- /*
-void XaTransaction::WaitForFlush() {
- isFlushedHandle->WaitOne();
-}
- */
-
-// called from DtxResourceManager Finalize
-
-void XaTransaction::ChildFinalize() {
- lock l(enlistedSessions);
- Phase0Flush();
- Cleanup();
-}
-
-
-
-}}} // namespace Apache::Qpid::Interop
diff --git a/qpid/wcf/src/Apache/Qpid/Interop/XaTransaction.h b/qpid/wcf/src/Apache/Qpid/Interop/XaTransaction.h deleted file mode 100644 index 8ff9f99893..0000000000 --- a/qpid/wcf/src/Apache/Qpid/Interop/XaTransaction.h +++ /dev/null @@ -1,96 +0,0 @@ -/*
-* 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.
-*/
-
-#pragma once
-
-namespace Apache {
-namespace Qpid {
-namespace Interop {
-
-using namespace System;
-using namespace System::Threading;
-using namespace System::Transactions;
-
-enum DtcCallbackType{
- DTC_PREPARE,
- DTC_COMMIT,
- DTC_ABORT,
- DTC_SINGLE_PHASE,
- DTC_TMDOWN
-};
-
-
-ref class DtxResourceManager;
-class DtcCallbackHandler;
-
-// Function pointer declaratiom for managed space delegate
-typedef bool (__stdcall *DtcCallbackFp)(DtcCallbackType);
-
-// and the delegate with the same signature
-public delegate bool DtcCallbackDelegate(DtcCallbackType);
-
-
-
-public ref class XaTransaction
-{
-private:
- bool active;
- DtxResourceManager^ resourceManager;
- Transaction^ systemTransaction;
- AmqpSession^ controlSession;
- Collections::Generic::List<AmqpSession^>^ enlistedSessions;
- qpid::framing::Xid* xidp;
- DtcCallbackHandler* nativeHandler;
- bool preparing;
- DtcCallbackDelegate^ inboundDelegate;
- // the Qpid async result of the AMQP dtx prepare/commit commands
- TypedResult<qpid::framing::XaResult>* commandCompletionp;
- // the Qpid async result of the first session to do dtx start
- TypedResult<qpid::framing::XaResult>* firstDtxStartCompletionp;
- ManualResetEvent^ completionHandle;
-
- AmqpSession^ firstEnlistedSession;
- DtcCallbackType currentCommand;
- void AsyncCompleter(Object ^);
- void Phase0Flush();
- void Cleanup();
- void Complete();
-
-internal:
- XaTransaction(Transaction^ t, IDtcToXaHelperSinglePipe *pXaHelper, DWORD rmCookie, DtxResourceManager^ rm);
- XaTransaction^ Enlist (AmqpSession ^session);
- bool DtcCallback (DtcCallbackType callback);
- void NotifyPhase0();
- void ChildFinalize();
- void SessionClosing(AmqpSession^ session);
- void WaitForCompletion();
-
- property IntPtr XidHandle {
- IntPtr get () { return (IntPtr) xidp; }
- }
-
-#ifdef QPID_RECOVERY_TEST_HOOK
- void ForceRecovery();
- bool debugFailMode;
-#endif
-
-};
-
-}}} // namespace Apache::Qpid::Interop
-
diff --git a/qpid/wcf/src/wcfnet.snk b/qpid/wcf/src/wcfnet.snk Binary files differdeleted file mode 100644 index d6456c8cf3..0000000000 --- a/qpid/wcf/src/wcfnet.snk +++ /dev/null diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/AsyncTest.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/AsyncTest.cs deleted file mode 100644 index 23bed6c603..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/AsyncTest.cs +++ /dev/null @@ -1,190 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.Threading; - using NUnit.Framework; - - [TestFixture] - public class AsyncTest - { - private const int MessageCount = 20; - private const string Queue = "amqp:amq.direct?routingkey=routing_key"; - private Uri endpoint = new Uri("amqp:message_queue"); - private TimeSpan standardTimeout = TimeSpan.FromSeconds(10.0); // seconds - - [Test] - public void NonTryReceives() - { - this.SendMessages(this.standardTimeout, this.standardTimeout); - this.ReceiveNonTryMessages(this.standardTimeout, this.standardTimeout); - } - - [Test] - public void TryReceives() - { - this.SendMessages(this.standardTimeout, this.standardTimeout); - this.ReceiveTryMessages(this.standardTimeout, this.standardTimeout); - } - - [Test] - public void SmallTimeout() - { - // This code is commented out due to a bug in asynchronous channel open. - ////IChannelListener parentListener; - ////try - ////{ - //// this.RetrieveAsyncChannel(new Uri("amqp:fake_queue_do_not_create"), TimeSpan.FromMilliseconds(10.0), out parentListener); - //// parentListener.Close(); - //// Assert.Fail("Accepting the channel did not time out."); - ////} - ////catch (TimeoutException) - ////{ - //// // Intended exception. - ////} - - try - { - this.ReceiveNonTryMessages(this.standardTimeout, TimeSpan.FromMilliseconds(10.0)); - Assert.Fail("Receiving a message did not time out."); - } - catch (TimeoutException) - { - // Intended exception. - } - } - - private void SendMessages(TimeSpan channelTimeout, TimeSpan messageSendTimeout) - { - ChannelFactory<IOutputChannel> channelFactory = - new ChannelFactory<IOutputChannel>(Util.GetBinding(), Queue); - IOutputChannel proxy = channelFactory.CreateChannel(); - IAsyncResult[] resultArray = new IAsyncResult[MessageCount]; - - for (int i = 0; i < MessageCount; i++) - { - Message toSend = Message.CreateMessage(MessageVersion.Default, string.Empty, i); - resultArray[i] = proxy.BeginSend(toSend, messageSendTimeout, null, null); - } - - for (int j = 0; j < MessageCount; j++) - { - proxy.EndSend(resultArray[j]); - } - - IAsyncResult iocCloseResult = proxy.BeginClose(channelTimeout, null, null); - Thread.Sleep(TimeSpan.FromMilliseconds(50.0)); // Dummy work - proxy.EndClose(iocCloseResult); - - IAsyncResult chanFactCloseResult = channelFactory.BeginClose(channelTimeout, null, null); - Thread.Sleep(TimeSpan.FromMilliseconds(50.0)); // Dummy work - channelFactory.EndClose(chanFactCloseResult); - } - - private void ReceiveNonTryMessages(TimeSpan channelTimeout, TimeSpan messageTimeout) - { - IChannelListener inputChannelParentListener; - IInputChannel inputChannel = this.RetrieveAsyncChannel(this.endpoint, channelTimeout, out inputChannelParentListener); - - inputChannel.Open(); - - IAsyncResult[] resultArray = new IAsyncResult[MessageCount]; - try - { - for (int i = 0; i < MessageCount; i++) - { - resultArray[i] = inputChannel.BeginReceive(messageTimeout, null, null); - } - - for (int j = 0; j < MessageCount; j++) - { - inputChannel.EndReceive(resultArray[j]); - } - } - finally - { - IAsyncResult channelCloseResult = inputChannel.BeginClose(channelTimeout, null, null); - Thread.Sleep(TimeSpan.FromMilliseconds(50.0)); // Dummy work - inputChannel.EndClose(channelCloseResult); - - // Asynchronous listener close has not been implemented. - ////IAsyncResult listenerCloseResult = inputChannelParentListener.BeginClose(channelTimeout, null, null); - ////Thread.Sleep(TimeSpan.FromMilliseconds(50.0)); // Dummy work - ////inputChannelParentListener.EndClose(listenerCloseResult); - - inputChannelParentListener.Close(); - } - } - - private void ReceiveTryMessages(TimeSpan channelAcceptTimeout, TimeSpan messageReceiveTimeout) - { - IChannelListener<IInputChannel> listener = Util.GetBinding().BuildChannelListener<IInputChannel>(this.endpoint, new BindingParameterCollection()); - listener.Open(); - IInputChannel inputChannel = listener.AcceptChannel(channelAcceptTimeout); - IAsyncResult channelResult = inputChannel.BeginOpen(channelAcceptTimeout, null, null); - Thread.Sleep(TimeSpan.FromMilliseconds(50.0)); - inputChannel.EndOpen(channelResult); - - IAsyncResult[] resultArray = new IAsyncResult[MessageCount]; - - for (int i = 0; i < MessageCount; i++) - { - resultArray[i] = inputChannel.BeginTryReceive(messageReceiveTimeout, null, null); - } - - for (int j = 0; j < MessageCount; j++) - { - Message tempMessage; - Assert.True(inputChannel.EndTryReceive(resultArray[j], out tempMessage), "Did not successfully receive message #{0}", j); - } - - inputChannel.Close(); - listener.Close(); - } - - private IInputChannel RetrieveAsyncChannel(Uri queue, TimeSpan timeout, out IChannelListener parentListener) - { - IChannelListener<IInputChannel> listener = - Util.GetBinding().BuildChannelListener<IInputChannel>(queue, new BindingParameterCollection()); - listener.Open(); - IInputChannel inputChannel; - - try - { - IAsyncResult acceptResult = listener.BeginAcceptChannel(timeout, null, null); - Thread.Sleep(TimeSpan.FromMilliseconds(300.0)); // Dummy work - inputChannel = listener.EndAcceptChannel(acceptResult); - } - catch (TimeoutException) - { - listener.Close(); - throw; - } - finally - { - parentListener = listener; - } - return inputChannel; - } - } -} diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/BasicTransactionTest.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/BasicTransactionTest.cs deleted file mode 100644 index fa3b79d3a7..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/BasicTransactionTest.cs +++ /dev/null @@ -1,173 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Test.Channel.Functional
-{
- using System;
- using System.Collections.Generic;
- using System.Reflection;
- using System.ServiceModel;
- using System.Threading;
- using NUnit.Framework;
-
- [TestFixture]
- public class BasicTransactionTest
- {
- private const string SendToUri = "amqp:amq.direct?routingkey=routing_key";
- private const string ListenUri = "amqp:message_queue";
-
- private MessageClient client;
-
- [SetUp]
- public void Setup()
- {
- // Create client
- this.client = new MessageClient();
- this.client.NumberOfMessages = 3;
- this.client.NumberOfIterations = 1;
-
- // Setup service
- MessageService.EndpointAddress = ListenUri;
- MessageService.ContractTypes = new List<Type>();
- MessageService.CompletionHandle = new EventWaitHandle(false, EventResetMode.AutoReset);
- }
-
- [TestCase(true)]
- [TestCase(false)]
- public void TransactionalSend(bool commitTransaction)
- {
- int expectedMessageCount = 0;
- this.client.TransactedSend = true;
-
- MessageService.ContractTypes.Add(typeof(IQueuedServiceUsingTSRAttribute));
- this.client.CommitTransaction = commitTransaction;
-
- if (commitTransaction)
- {
- expectedMessageCount = this.client.NumberOfIterations * this.client.NumberOfMessages * MessageService.ContractTypes.Count;
- }
-
- // Call Service methods.
- this.SendMessages(String.Empty);
-
- // Validate results.
- int actualMessageCount = Util.GetMessageCountFromQueue(ListenUri);
- Assert.AreEqual(expectedMessageCount, actualMessageCount, "The actual message count wasn't as expected.");
- }
-
- [TestCase("UseTransactionScope", true)]
- [TestCase("UseTransactionScope", false)]
- [TestCase("UseTSRAttribute", true)]
- [TestCase("UseTSRAttribute", false)]
- public void TransactionalReceive(string testVariation, bool commitTransaction)
- {
- bool testPassed = true;
- int expectedMessageCount = 0;
- this.client.TransactedSend = false;
- string transactionOutcome = "Commit";
-
- switch (testVariation.Trim().ToLower())
- {
- case "usetransactionscope":
- {
- MessageService.ContractTypes.Add(typeof(IQueuedServiceUsingTransactionScope));
- }
-
- break;
- case "usetsrattribute":
- {
- MessageService.ContractTypes.Add(typeof(IQueuedServiceUsingTSRAttribute));
- }
-
- break;
- }
-
- int expectedMethodCallCount = this.client.NumberOfIterations * this.client.NumberOfMessages * MessageService.ContractTypes.Count;
-
- if (!commitTransaction)
- {
- expectedMessageCount = expectedMethodCallCount;
- transactionOutcome = "Abort";
- }
-
- MessageService.IntendedInvocationCount = expectedMethodCallCount;
-
- // Start the service.
- MessageService.StartService(Util.GetBinding());
-
- // Call Service methods.
- this.SendMessages(transactionOutcome);
-
- // Allow the wcf service to process all the messages before validation.
- if (!MessageService.CompletionHandle.WaitOne(TimeSpan.FromSeconds(10.0), false))
- {
- Console.WriteLine("The service did not finish processing messages in 10 seconds. Test will be FAILED");
- testPassed = false;
- }
-
- MessageService.StopService();
-
- // Validate results.
- if (expectedMethodCallCount > MessageService.TotalMethodCallCount)
- {
- Console.WriteLine("The expected method call count was {0} but got {1}.", expectedMethodCallCount, MessageService.TotalMethodCallCount);
- testPassed = false;
- }
-
- int actualMessageCount = Util.GetMessageCountFromQueue(ListenUri);
- if (expectedMessageCount != actualMessageCount)
- {
- Console.WriteLine("The expected message count was {0} but got {1}.", expectedMessageCount, actualMessageCount);
- testPassed = false;
- }
-
- Assert.AreEqual(true, testPassed, "Results not as expected. Testcase FAILED.");
-
- }
-
- [TearDown]
- public void Cleanup()
- {
- if (MessageService.IsServiceRunning())
- {
- MessageService.StopService();
- }
- }
-
- private void SendMessages(string messageString)
- {
- // Create messages to send.
- string[] messages = new string[this.client.NumberOfMessages];
- for (int i = 0; i < this.client.NumberOfMessages; ++i)
- {
- messages[i] = messageString + " Message " + i;
- }
-
- // Create Amqpchannel and send messages.
- MethodInfo runClientMethod = this.client.GetType().GetMethod("RunTestClient");
- EndpointAddress address = new EndpointAddress(SendToUri);
-
- foreach (Type contractType in MessageService.ContractTypes)
- {
- MethodInfo runClientT = runClientMethod.MakeGenericMethod(contractType);
- runClientT.Invoke(this.client, new object[] { address, messages });
- }
- }
- }
-}
diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelAbortCommitTest.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelAbortCommitTest.cs deleted file mode 100644 index 9c9a6c095e..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelAbortCommitTest.cs +++ /dev/null @@ -1,113 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Test.Channel.Functional
-{
- using System.Collections.Generic;
- using System.ServiceModel.Channels;
- using NUnit.Framework;
-
- [TestFixture(1, true, false, true, true)]
- [TestFixture(1, true, false, true, false)]
- [TestFixture(1, true, false, false, true)]
- [TestFixture(1, true, false, false, false)]
- [TestFixture(1, false, true, true, true)]
- [TestFixture(1, false, true, true, false)]
- [TestFixture(1, false, true, false, true)]
- [TestFixture(1, false, true, false, false)]
- [TestFixture(5, true, false, true, true)]
- [TestFixture(5, true, false, true, false)]
- [TestFixture(5, true, false, false, true)]
- [TestFixture(5, true, false, false, false)]
- [TestFixture(5, false, true, true, true)]
- [TestFixture(5, false, true, true, false)]
- [TestFixture(5, false, true, false, true)]
- [TestFixture(5, false, true, false, false)]
- public class ChannelAbortCommitTest
- {
- private const string SendToUri = "amqp:amq.direct?routingkey=routing_key";
- private const string ListenUri = "amqp:message_queue";
-
- private ChannelContextParameters contextParameters;
- private Binding channelBinding;
- private List<string> expectedResults;
-
- public ChannelAbortCommitTest(int numberOfThreads, bool sendAbort, bool receiveAbort, bool asyncSend, bool asyncReceive)
- {
- this.contextParameters = new ChannelContextParameters();
- this.contextParameters.NumberOfThreads = numberOfThreads;
- this.contextParameters.SenderShouldAbort = sendAbort;
- this.contextParameters.ReceiverShouldAbort = receiveAbort;
- this.contextParameters.AsyncSend = asyncSend;
- this.contextParameters.AsyncReceive = asyncReceive;
- }
-
- [SetUp]
- public void Setup()
- {
- this.channelBinding = Util.GetBinding();
- this.GenerateExpectedResults();
- }
-
- [Test]
- public void Run()
- {
- ChannelReceiver receiver = new ChannelReceiver(this.contextParameters, this.channelBinding);
- ChannelSender sender = new ChannelSender(this.contextParameters, this.channelBinding);
-
- sender.Run(SendToUri);
- receiver.Run(ListenUri);
-
- // Validate results.
- bool comparisonOutcome = Util.CompareResults(this.expectedResults, receiver.Results);
- Assert.AreEqual(true, comparisonOutcome, "The actual results were not as expected");
- Assert.AreEqual(0, Util.GetMessageCountFromQueue(ListenUri), "The actual message count wasn't as expected.");
- }
-
- [TearDown]
- public void Cleanup()
- {
- Util.PurgeQueue(ListenUri);
- }
-
- private void GenerateExpectedResults()
- {
- this.expectedResults = new List<string>();
-
- if (this.contextParameters.NumberOfThreads == 1)
- {
- this.expectedResults.Add("Received message with Action 'FirstMessage'");
- this.expectedResults.Add("Received message with Action 'Message 1'");
- this.expectedResults.Add("Received message with Action 'Message 2'");
- this.expectedResults.Add("Received message with Action 'Message 3'");
- this.expectedResults.Add("Received message with Action 'Message 4'");
- this.expectedResults.Add("Received message with Action 'Message 5'");
- }
- else
- {
- this.expectedResults.Add("Received message with Action 'FirstMessage'");
- this.expectedResults.Add("Received message with Action 'Message'");
- this.expectedResults.Add("Received message with Action 'Message'");
- this.expectedResults.Add("Received message with Action 'Message'");
- this.expectedResults.Add("Received message with Action 'Message'");
- this.expectedResults.Add("Received message with Action 'Message'");
- }
- }
- }
-}
diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelContextParameters.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelContextParameters.cs deleted file mode 100644 index 35e32ce25a..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelContextParameters.cs +++ /dev/null @@ -1,229 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Test.Channel.Functional
-{
- using System;
-
- public class ChannelContextParameters
- {
- public ChannelContextParameters()
- {
- this.NumberOfMessages = 5;
- this.NumberOfThreads = 1;
- this.ReceiveTimeout = TimeSpan.FromSeconds(10.0);
- this.WaitForSender = true;
- this.UseAcceptChannelTimeout = true;
- this.CreateChannel = true;
- this.DoneSendingTimeout = TimeSpan.FromSeconds(10);
- this.TransactionScopeTimeout = TimeSpan.FromMinutes(1);
- this.AcceptChannelTimeout = TimeSpan.FromSeconds(10);
- this.OpenTimeout = TimeSpan.FromSeconds(10);
- this.ClientCommitDelay = TimeSpan.Zero;
- this.WaitForChannelTimeout = TimeSpan.FromSeconds(5);
- this.WaitForMessageTimeout = TimeSpan.FromSeconds(5);
- }
-
- public int NumberOfMessages
- {
- get;
- set;
- }
-
- public int NumberOfThreads
- {
- get;
- set;
- }
-
- public TimeSpan ReceiveTimeout
- {
- get;
- set;
- }
-
- public bool SenderShouldAbort
- {
- get;
- set;
- }
-
- public bool ReceiverShouldAbort
- {
- get;
- set;
- }
-
- public bool AsyncSend
- {
- get;
- set;
- }
-
- public bool AsyncReceive
- {
- get;
- set;
- }
-
- public bool SendWithoutTransaction
- {
- get;
- set;
- }
-
- public bool ReceiveWithoutTransaction
- {
- get;
- set;
- }
-
- public bool SendWithMultipleTransactions
- {
- get;
- set;
- }
-
- public bool ReceiveWithMultipleTransactions
- {
- get;
- set;
- }
-
- public bool CloseBeforeReceivingAll
- {
- get;
- set;
- }
-
- public bool WaitForSender
- {
- get;
- set;
- }
-
- public TimeSpan DoneSendingTimeout
- {
- get;
- set;
- }
-
- public TimeSpan TransactionScopeTimeout
- {
- get;
- set;
- }
-
- public TimeSpan AcceptChannelTimeout
- {
- get;
- set;
- }
-
- public TimeSpan OpenTimeout
- {
- get;
- set;
- }
-
- public bool UseAcceptChannelTimeout
- {
- get;
- set;
- }
-
- public bool CreateChannel
- {
- get;
- set;
- }
-
- public TimeSpan ClientCommitDelay
- {
- get;
- set;
- }
-
- public bool AsyncAccept
- {
- get;
- set;
- }
-
- public bool CloseListenerEarly
- {
- get;
- set;
- }
-
- public bool AbortTxDatagramAccept
- {
- get;
- set;
- }
-
- public bool WaitForChannel
- {
- get;
- set;
- }
-
- public TimeSpan WaitForChannelTimeout
- {
- get;
- set;
- }
-
- public bool AsyncWaitForChannel
- {
- get;
- set;
- }
-
- public bool WaitForMessage
- {
- get;
- set;
- }
-
- public TimeSpan WaitForMessageTimeout
- {
- get;
- set;
- }
-
- public bool AsyncWaitForMessage
- {
- get;
- set;
- }
-
- public bool TryReceive
- {
- get;
- set;
- }
-
- public bool TryReceiveNullIAsyncResult
- {
- get;
- set;
- }
- }
-}
diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelEntity.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelEntity.cs deleted file mode 100644 index 9cabae3201..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelEntity.cs +++ /dev/null @@ -1,72 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Test.Channel.Functional
-{
- using System;
- using System.Collections.Generic;
- using System.ServiceModel.Channels;
-
- public abstract class ChannelEntity
- {
- public ChannelEntity(ChannelContextParameters contextParameters, Binding channelBinding)
- {
- this.Parameters = contextParameters;
- this.Binding = channelBinding;
- this.Results = new List<string>();
- }
-
- protected ChannelContextParameters Parameters
- {
- get;
- set;
- }
-
- protected Binding Binding
- {
- get;
- set;
- }
-
- public List<string> Results
- {
- get;
- set;
- }
-
- public abstract void Run(string serviceUri);
-
- protected void WaitForChannel(IChannelListener listener, bool async, TimeSpan timeout)
- {
- bool ret = false;
-
- if (async)
- {
- IAsyncResult result = listener.BeginWaitForChannel(timeout, null, null);
- ret = listener.EndWaitForChannel(result);
- }
- else
- {
- ret = listener.WaitForChannel(timeout);
- }
-
- this.Results.Add(String.Format("WaitForChannel returned {0}", ret));
- }
- }
-}
diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelReceiver.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelReceiver.cs deleted file mode 100644 index 20af98fa64..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelReceiver.cs +++ /dev/null @@ -1,280 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Test.Channel.Functional
-{
- using System;
- using System.ServiceModel;
- using System.ServiceModel.Channels;
- using System.Threading;
- using System.Transactions;
-
- public class ChannelReceiver : ChannelEntity
- {
- public ChannelReceiver(ChannelContextParameters contextParameters, Binding channelBinding)
- : base(contextParameters, channelBinding)
- {
- }
-
- public override void Run(string listenUri)
- {
- IChannelListener<IInputChannel> listener = this.Binding.BuildChannelListener<IInputChannel>(new Uri(listenUri));
- listener.Open();
-
- if (this.Parameters.WaitForChannel)
- {
- this.WaitForChannel(listener, this.Parameters.AsyncWaitForChannel, this.Parameters.WaitForChannelTimeout);
- }
-
- this.AcceptChannelAndReceive(listener);
-
- if (listener.State != CommunicationState.Closed)
- {
- listener.Close();
- }
- }
-
- private void AcceptChannelAndReceive(IChannelListener<IInputChannel> listener)
- {
- IInputChannel channel;
- TransactionScope transactionToAbortOnAccept = null;
-
- if (this.Parameters.AbortTxDatagramAccept)
- {
- transactionToAbortOnAccept = new TransactionScope(TransactionScopeOption.RequiresNew);
- }
-
- if (this.Parameters.AsyncAccept)
- {
- IAsyncResult result = listener.BeginAcceptChannel(null, null);
- channel = listener.EndAcceptChannel(result);
- }
- else
- {
- channel = listener.AcceptChannel();
- }
-
- if (this.Parameters.AbortTxDatagramAccept)
- {
- transactionToAbortOnAccept.Dispose();
- }
-
- channel.Open();
- Message message;
-
- if (this.Parameters.CloseListenerEarly)
- {
- listener.Close();
- }
-
- try
- {
- using (TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew))
- {
- Message firstMessage = channel.Receive(this.Parameters.ReceiveTimeout);
-
- lock (this.Results)
- {
- this.Results.Add(String.Format("Received message with Action '{0}'", firstMessage.Headers.Action));
- }
-
- ts.Complete();
- }
- }
- catch (TimeoutException)
- {
- lock (this.Results)
- {
- this.Results.Add("Receive timed out.");
- }
-
- channel.Abort();
- return;
- }
-
- AutoResetEvent doneReceiving = new AutoResetEvent(false);
- int threadsCompleted = 0;
-
- for (int i = 0; i < this.Parameters.NumberOfThreads; ++i)
- {
- ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object unused)
- {
- do
- {
- if (this.Parameters.ReceiverShouldAbort)
- {
- this.ReceiveMessage(channel, false);
- Thread.Sleep(200);
- }
-
- message = this.ReceiveMessage(channel, true);
- }
- while (message != null);
-
- if (Interlocked.Increment(ref threadsCompleted) == this.Parameters.NumberOfThreads)
- {
- doneReceiving.Set();
- }
- }));
- }
-
- TimeSpan threadTimeout = TimeSpan.FromMinutes(2.0);
- if (!doneReceiving.WaitOne(threadTimeout, false))
- {
- this.Results.Add(String.Format("Threads did not complete within {0}.", threadTimeout));
- }
-
- channel.Close();
- }
-
- private Message ReceiveMessage(IInputChannel channel, bool commit)
- {
- Message message = null;
-
- using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
- {
- bool messageDetected = false;
- if (this.Parameters.AsyncWaitForMessage)
- {
- IAsyncResult result = channel.BeginWaitForMessage(this.Parameters.WaitForMessageTimeout, null, null);
- messageDetected = channel.EndWaitForMessage(result);
- }
- else
- {
- messageDetected = channel.WaitForMessage(this.Parameters.WaitForMessageTimeout);
- }
-
- if (this.Parameters.WaitForMessage)
- {
- lock (this.Results)
- {
- this.Results.Add(String.Format("WaitForMessage returned {0}", messageDetected));
- }
- }
-
- if (messageDetected)
- {
- if (this.Parameters.AsyncReceive)
- {
- if (this.Parameters.TryReceive)
- {
- IAsyncResult result = channel.BeginTryReceive(this.Parameters.ReceiveTimeout, null, null);
- bool ret = channel.EndTryReceive(result, out message);
-
- lock (this.Results)
- {
- this.Results.Add(String.Format("TryReceive returned {0}", ret));
- }
- }
- else
- {
- try
- {
- IAsyncResult result = channel.BeginReceive(this.Parameters.ReceiveTimeout, null, null);
- message = channel.EndReceive(result);
- }
- catch (TimeoutException)
- {
- message = null;
- }
- }
- }
- else
- {
- if (this.Parameters.TryReceive)
- {
- bool ret = channel.TryReceive(this.Parameters.ReceiveTimeout, out message);
-
- lock (this.Results)
- {
- this.Results.Add(String.Format("TryReceive returned {0}", ret));
- }
- }
- else
- {
- try
- {
- message = channel.Receive(this.Parameters.ReceiveTimeout);
- }
- catch (TimeoutException)
- {
- message = null;
- }
- }
- }
- }
- else
- {
- if (this.Parameters.TryReceive)
- {
- bool ret = false;
- if (this.Parameters.AsyncReceive)
- {
- IAsyncResult result = channel.BeginTryReceive(this.Parameters.ReceiveTimeout, null, null);
- if (this.Parameters.TryReceiveNullIAsyncResult)
- {
- try
- {
- channel.EndTryReceive(null, out message);
- }
- catch (Exception e)
- {
- lock (this.Results)
- {
- this.Results.Add(String.Format("TryReceive threw {0}", e.GetType().Name));
- }
- }
- }
-
- ret = channel.EndTryReceive(result, out message);
- }
- else
- {
- ret = channel.TryReceive(this.Parameters.ReceiveTimeout, out message);
- }
-
- lock (this.Results)
- {
- this.Results.Add(String.Format("TryReceive returned {0}", ret));
- this.Results.Add(String.Format("Message was {0}", (message == null ? "null" : "not null")));
- }
- }
-
- message = null;
- }
-
- if (commit && message != null)
- {
- lock (this.Results)
- {
- this.Results.Add(String.Format("Received message with Action '{0}'", message.Headers.Action));
- }
-
- ts.Complete();
- }
- else
- {
- Transaction.Current.Rollback();
- }
- }
-
- return message;
- }
- }
-}
diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelSender.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelSender.cs deleted file mode 100644 index 78950dc0d5..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/ChannelSender.cs +++ /dev/null @@ -1,138 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Test.Channel.Functional
-{
- using System;
- using System.ServiceModel;
- using System.ServiceModel.Channels;
- using System.Threading;
- using System.Transactions;
-
- public class ChannelSender : ChannelEntity
- {
- public ChannelSender(ChannelContextParameters contextParameters, Binding channelBinding)
- : base(contextParameters, channelBinding)
- {
- }
-
- public override void Run(string sendTo)
- {
- IChannelFactory<IOutputChannel> factory = this.Binding.BuildChannelFactory<IOutputChannel>();
- factory.Open();
-
- if (this.Parameters.CreateChannel)
- {
- IOutputChannel channel = factory.CreateChannel(new EndpointAddress(sendTo));
- this.SendMessages(channel);
- }
-
- factory.Close();
- }
-
- private void SendMessages(IOutputChannel channel)
- {
- channel.Open();
-
- AutoResetEvent doneSending = new AutoResetEvent(false);
- int threadsCompleted = 0;
-
- if (this.Parameters.NumberOfMessages > 0)
- {
- this.SendMessage(channel, "FirstMessage", true);
- }
-
- if (this.Parameters.NumberOfThreads == 1)
- {
- for (int j = 0; j < this.Parameters.NumberOfMessages; ++j)
- {
- if (this.Parameters.SenderShouldAbort)
- {
- this.SendMessage(channel, "Message " + (j + 1), false);
- }
-
- this.SendMessage(channel, "Message " + (j + 1), true);
- }
-
- doneSending.Set();
- }
- else
- {
- for (int i = 0; i < this.Parameters.NumberOfThreads; ++i)
- {
- ThreadPool.QueueUserWorkItem(new WaitCallback(delegate(object unused)
- {
- for (int j = 0; j < this.Parameters.NumberOfMessages / this.Parameters.NumberOfThreads; ++j)
- {
- if (this.Parameters.SenderShouldAbort)
- {
- this.SendMessage(channel, "Message", false);
- }
-
- this.SendMessage(channel, "Message", true);
- }
- if (Interlocked.Increment(ref threadsCompleted) == this.Parameters.NumberOfThreads)
- {
- doneSending.Set();
- }
- }));
- }
- }
-
- TimeSpan threadTimeout = TimeSpan.FromMinutes(2.0);
- if (!doneSending.WaitOne(threadTimeout, false))
- {
- lock (this.Results)
- {
- this.Results.Add(String.Format("Threads did not complete within {0}.", threadTimeout));
- }
- }
-
- doneSending.Close();
- channel.Close();
- }
-
- private void SendMessage(IOutputChannel channel, string action, bool commit)
- {
- using (TransactionScope ts = new TransactionScope(TransactionScopeOption.RequiresNew))
- {
- Message message = Message.CreateMessage(MessageVersion.Default, action);
-
- if (this.Parameters.AsyncSend)
- {
- IAsyncResult result = channel.BeginSend(message, null, null);
- channel.EndSend(result);
- }
- else
- {
- channel.Send(message);
- }
-
- if (commit)
- {
- ts.Complete();
- }
- else
- {
- Transaction.Current.Rollback();
- }
- }
- }
- }
-}
diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/CustomAmqpBindingTest.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/CustomAmqpBindingTest.cs deleted file mode 100644 index 45a926ce4d..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/CustomAmqpBindingTest.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System; - using System.Collections.Generic; - using System.Reflection; - using System.ServiceModel; - using System.Threading; - using NUnit.Framework; - - [TestFixture] - public class CustomAmqpBindingTest - { - private MessageClient client; - - [SetUp] - public void Setup() - { - // Create client - this.client = new MessageClient(); - this.client.NumberOfMessages = 3; - this.client.NumberOfIterations = 3; - - // Setup and start service - MessageService.EndpointAddress = "amqp:message_queue"; - MessageService.ContractTypes = new List<Type>(); - MessageService.ContractTypes.Add(typeof(IInteropService)); - MessageService.CompletionHandle = new EventWaitHandle(false, EventResetMode.AutoReset); - MessageService.IntendedInvocationCount = this.client.NumberOfIterations * this.client.NumberOfMessages * MessageService.ContractTypes.Count; - MessageService.StartService(Util.GetCustomBinding()); - } - - [Test] - public void Run() - { - // Create the WCF AMQP channel and send messages - MethodInfo runClientMethod = this.client.GetType().GetMethod("RunInteropClient"); - EndpointAddress address = new EndpointAddress("amqp:amq.direct?routingkey=routing_key"); - foreach (Type contractType in MessageService.ContractTypes) - { - MethodInfo runClientT = runClientMethod.MakeGenericMethod(contractType); - runClientT.Invoke(this.client, new object[] { address }); - } - - // Allow the WCF service to process all the messages before validation - MessageService.CompletionHandle.WaitOne(TimeSpan.FromSeconds(10.0), false); - - // Validation - int expectedMethodCallCount = this.client.NumberOfIterations * this.client.NumberOfMessages * MessageService.ContractTypes.Count; - Assert.AreEqual(expectedMethodCallCount, MessageService.TotalMethodCallCount); - } - - [TearDown] - public void Cleanup() - { - MessageService.StopService(); - } - } -} diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/FunctionalTests.csproj b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/FunctionalTests.csproj deleted file mode 100644 index ab36222d6a..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/FunctionalTests.csproj +++ /dev/null @@ -1,121 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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.30729</ProductVersion>
- <SchemaVersion>2.0</SchemaVersion>
- <ProjectGuid>{E2D8C779-E417-40BA-BEE1-EE034268482F}</ProjectGuid>
- <OutputType>Library</OutputType>
- <AppDesignerFolder>Properties</AppDesignerFolder>
- <RootNamespace>Apache.Qpid.Test.Channel.Functional</RootNamespace>
- <AssemblyName>Apache.Qpid.Test.Channel.Functional</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>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="nunit.framework, Version=2.5.2.9222, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- </Reference>
- <Reference Include="System" />
- <Reference Include="System.Core">
- <RequiredTargetFramework>3.5</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Runtime.Serialization">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Transactions" />
- <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="AsyncTest.cs" />
- <Compile Include="ChannelAbortCommitTest.cs" />
- <Compile Include="ChannelContextParameters.cs" />
- <Compile Include="ChannelEntity.cs" />
- <Compile Include="ChannelReceiver.cs" />
- <Compile Include="ChannelSender.cs" />
- <Compile Include="CustomAmqpBindingTest.cs" />
- <Compile Include="IGenericObjectService.cs" />
- <Compile Include="IInteropService.cs" />
- <Compile Include="IQueuedDatagramService1.cs" />
- <Compile Include="IQueuedDatagramService2.cs" />
- <Compile Include="IQueuedDatagramService3.cs" />
- <Compile Include="IQueuedServiceUsingTransactionScope.cs" />
- <Compile Include="IQueuedServiceUsingTSRAttribute.cs" />
- <Compile Include="MessageBodyTest.cs" />
- <Compile Include="MessagePropertiesTest.cs" />
- <Compile Include="MultipleEndpointsSameQueueTest.cs" />
- <Compile Include="MessageClient.cs" />
- <Compile Include="MessageService.cs" />
- <Compile Include="Properties\AssemblyInfo.cs" />
- <Compile Include="BasicTransactionTest.cs" />
- <Compile Include="Util.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\..\..\..\src\Apache\Qpid\Channel\Channel.csproj">
- <Project>{8AABAB30-7D1E-4539-B7D1-05450262BAD2}</Project>
- <Name>Channel</Name>
- </ProjectReference>
- <ProjectReference Include="..\..\..\..\..\..\src\Apache\Qpid\Interop\Interop.vcproj">
- <Project>{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}</Project>
- <Name>Interop</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>
- -->
- <PropertyGroup>
- <PostBuildEvent>
- </PostBuildEvent>
- </PropertyGroup>
-</Project>
\ No newline at end of file diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IGenericObjectService.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IGenericObjectService.cs deleted file mode 100644 index a1ffac50b3..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IGenericObjectService.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System.ServiceModel; - - [ServiceContract(SessionMode = SessionMode.NotAllowed)] - public interface IGenericObjectService - { - [OperationContract(IsOneWay = true)] - void SendObject(object message); - } -} diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IInteropService.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IInteropService.cs deleted file mode 100644 index 25f7010a89..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IInteropService.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System.ServiceModel; - using System.ServiceModel.Channels; - - [ServiceContract] - public interface IInteropService - { - [OperationContract(IsOneWay = true, Action = "*")] - void Hello(Message message); - } -}
\ No newline at end of file diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedDatagramService1.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedDatagramService1.cs deleted file mode 100644 index 8abbe04874..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedDatagramService1.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System.ServiceModel; - - [ServiceContract(SessionMode = SessionMode.NotAllowed)] - public interface IQueuedDatagramService1 - { - [OperationContract(IsOneWay = true)] - void Hello(string message); - - [OperationContract(IsOneWay = true)] - void Goodbye(); - } -}
\ No newline at end of file diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedDatagramService2.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedDatagramService2.cs deleted file mode 100644 index 7d056e9c82..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedDatagramService2.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System.ServiceModel; - - [ServiceContract(SessionMode = SessionMode.NotAllowed)] - public interface IQueuedDatagramService2 - { - [OperationContract(IsOneWay = true)] - void Hello(string message); - - [OperationContract(IsOneWay = true)] - void Goodbye(); - } -}
\ No newline at end of file diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedDatagramService3.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedDatagramService3.cs deleted file mode 100644 index 3ff2085557..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedDatagramService3.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System.ServiceModel; - - [ServiceContract(SessionMode = SessionMode.NotAllowed)] - public interface IQueuedDatagramService3 - { - [OperationContract(IsOneWay = true)] - void Hello(string message); - - [OperationContract(IsOneWay = true)] - void Goodbye(); - } -}
\ No newline at end of file diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedServiceUsingTSRAttribute.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedServiceUsingTSRAttribute.cs deleted file mode 100644 index 49c42a25b6..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedServiceUsingTSRAttribute.cs +++ /dev/null @@ -1,30 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Test.Channel.Functional
-{
- using System.ServiceModel;
-
- [ServiceContract]
- public interface IQueuedServiceUsingTSRAttribute
- {
- [OperationContract(IsOneWay = true)]
- void Hello(string message);
- }
-}
diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedServiceUsingTransactionScope.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedServiceUsingTransactionScope.cs deleted file mode 100644 index eabceb5720..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/IQueuedServiceUsingTransactionScope.cs +++ /dev/null @@ -1,30 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Test.Channel.Functional
-{
- using System.ServiceModel;
-
- [ServiceContract]
- public interface IQueuedServiceUsingTransactionScope
- {
- [OperationContract(IsOneWay = true)]
- void Hello(string message);
- }
-}
diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageBodyTest.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageBodyTest.cs deleted file mode 100644 index a9555d190d..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageBodyTest.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System; - using System.Runtime.Serialization; - using System.ServiceModel; - using System.ServiceModel.Channels; - using NUnit.Framework; - - [TestFixture] - public class MessageBodyTest - { - private const string Queue = "amqp:amq.direct?routingkey=routing_key"; - - [Test] - public void DateVariation() - { - DateTime rightNow = DateTime.UtcNow; - this.SendMessage(rightNow); - this.ReceiveMessage<DateTime>(rightNow); - } - - [Test] - public void EmptyStringVariation() - { - const string TestString = ""; - this.SendMessage(TestString); - this.ReceiveMessage<string>(TestString); - } - - [Test] - public void IntPrimitiveVariation() - { - const int TheAnswer = 42; - this.SendMessage(TheAnswer); - this.ReceiveMessage<int>(TheAnswer); - } - - [Test] - public void MultipleIntVariation() - { - const int NumberOfMessages = 20; - int[] listOfNumbers = new int[NumberOfMessages]; - - for (int i = 0; i < NumberOfMessages; i++) - { - this.SendMessage(i); - listOfNumbers[i] = i; - } - - Assert.True(listOfNumbers[NumberOfMessages - 1] != 0, "Not all messages were sent."); - - for (int j = 0; j < NumberOfMessages; j++) - { - int receivedNumber = this.ReceiveMessage<int>(); - Assert.True(listOfNumbers[j].Equals(receivedNumber), "Received {0} - this number is unknown or has been received more than once.", receivedNumber); - } - } - - [Test] - public void StringVariation() - { - const string TestString = "The darkest of dim, dreary days dost draw deathly deeds. どーも"; - this.SendMessage(TestString); - this.ReceiveMessage<string>(TestString); - } - - private void SendMessage(object objectToSend) - { - IChannelFactory<IOutputChannel> channelFactory = - Util.GetBinding().BuildChannelFactory<IOutputChannel>(); - channelFactory.Open(); - IOutputChannel proxy = channelFactory.CreateChannel(new EndpointAddress(Queue)); - proxy.Open(); - Message toSend = Message.CreateMessage(MessageVersion.Default, string.Empty, objectToSend); - proxy.Send(toSend); - toSend.Close(); - channelFactory.Close(); - } - - private TObjectType ReceiveMessage<TObjectType>() - { - Uri endpoint = new Uri("amqp:message_queue"); - IChannelListener<IInputChannel> listener = Util.GetBinding().BuildChannelListener<IInputChannel>(endpoint, new BindingParameterCollection()); - listener.Open(); - IInputChannel service = listener.AcceptChannel(TimeSpan.FromSeconds(10)); - service.Open(); - Message receivedMessage = service.Receive(TimeSpan.FromSeconds(10)); - Assert.NotNull(receivedMessage, "Message was not received"); - try - { - TObjectType receivedObject = receivedMessage.GetBody<TObjectType>(); - return receivedObject; - } - catch (SerializationException) - { - Assert.Fail("Deserialized object not of correct type"); - } - finally - { - receivedMessage.Close(); - service.Close(); - listener.Close(); - } - - return default(TObjectType); - } - - private TObjectType ReceiveMessage<TObjectType>(TObjectType objectToMatch) - { - TObjectType receivedObject = this.ReceiveMessage<TObjectType>(); - Assert.True(objectToMatch.Equals(receivedObject), "Original and deserialized objects do not match"); - return receivedObject; - } - } -} diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageClient.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageClient.cs deleted file mode 100644 index b623a0196b..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageClient.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System; - using System.Reflection; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.Transactions; - - public class MessageClient - { - public int NumberOfMessages - { - get; - set; - } - - public int NumberOfIterations - { - get; - set; - } - - public bool TransactedSend - { - get; - set; - } - - public bool CommitTransaction - { - get; - set; - } - - public void RunClient<TServiceContract>(EndpointAddress address) - { - string[] messages = new string[this.NumberOfMessages]; - for (int i = 0; i < this.NumberOfMessages; ++i) - { - messages[i] = "Message " + i; - } - - RunTestClient<TServiceContract>(address, messages); - } - - public void RunTestClient<TServiceContract>(EndpointAddress address, object[] messages) - { - Binding amqpBinding = Util.GetBinding(); - Type proxyType = typeof(TServiceContract); - MethodInfo helloMethod = proxyType.GetMethod("Hello"); - MethodInfo goodbyeMethod = proxyType.GetMethod("Goodbye"); - - for (int i = 0; i < this.NumberOfIterations; ++i) - { - this.CreateChannelAndSendMessages<TServiceContract>(address, amqpBinding, helloMethod, goodbyeMethod, messages); - } - } - - public void RunInteropClient<TServiceContract>(EndpointAddress address) - { - Binding amqpBinding = Util.GetBinding(); - Type proxyType = typeof(TServiceContract); - MethodInfo helloMethod = proxyType.GetMethod("Hello"); - - Message[] messages = new Message[this.NumberOfMessages]; - - for (int i = 0; i < this.NumberOfIterations; ++i) - { - this.CreateInteropChannelAndSendMessages<TServiceContract>(address, amqpBinding, helloMethod, this.NumberOfMessages); - } - } - - private void CreateChannelAndSendMessages<TServiceContract>(EndpointAddress address, Binding amqpBinding, MethodInfo helloMethod, MethodInfo goodbyeMethod, object[] messages) - { - ChannelFactory<TServiceContract> channelFactory = new ChannelFactory<TServiceContract>(amqpBinding, address); - TServiceContract proxy = channelFactory.CreateChannel(); - - if (this.TransactedSend) - { - using (TransactionScope tx = new TransactionScope(TransactionScopeOption.Required, TimeSpan.FromMinutes(20))) - { - foreach (object message in messages) - { - helloMethod.Invoke(proxy, new object[] { message }); - } - - if (goodbyeMethod != null) - { - goodbyeMethod.Invoke(proxy, new object[0]); - } - - if (this.CommitTransaction) - { - tx.Complete(); - } - } - } - else - { - foreach (object message in messages) - { - helloMethod.Invoke(proxy, new object[] { message }); - } - - if (goodbyeMethod != null) - { - goodbyeMethod.Invoke(proxy, new object[0]); - } - } - } - - private void CreateInteropChannelAndSendMessages<TServiceContract>(EndpointAddress address, Binding amqpBinding, MethodInfo helloMethod, int messageCount) - { - ChannelFactory<TServiceContract> channelFactory = new ChannelFactory<TServiceContract>(amqpBinding, address); - TServiceContract proxy = channelFactory.CreateChannel(); - - for (int i = 0; i < messageCount; i++) - { - helloMethod.Invoke(proxy, new object[] { Message.CreateMessage(MessageVersion.Soap12WSAddressing10, "*") }); - } - - channelFactory.Close(); - } - } -} diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageProperties.txt b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageProperties.txt deleted file mode 100644 index bd6459ccb9..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageProperties.txt +++ /dev/null @@ -1,22 +0,0 @@ -/* -* 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. -*/ -ContentType=Text -Durable=true -RoutingKey=routing_key -TimeToLive=00:00:10
\ No newline at end of file diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessagePropertiesTest.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessagePropertiesTest.cs deleted file mode 100644 index 8e192e90f1..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessagePropertiesTest.cs +++ /dev/null @@ -1,131 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System; - using System.Collections.Generic; - using System.Reflection; - using System.Runtime.Serialization; - using System.ServiceModel; - using System.ServiceModel.Channels; - using Apache.Qpid.AmqpTypes; - using NUnit.Framework; - - [TestFixture] - public class MessagePropertiesTest - { - private const string RoutingKey = "routing_key"; - private const string SendToUri = "amqp:amq.direct?routingkey=" + RoutingKey; - - [Test] - public void DefaultAmqpProperties() - { - const string TestString = "Test Message"; - AmqpProperties messageProperties = new AmqpProperties(); - - this.SendMessage(TestString, messageProperties); - this.ReceiveMessage<string>(TestString, messageProperties); - } - - [Test] - public void NonDefaultAmqpProperties() - { - const string TestString = "Test Message"; - AmqpProperties messageProperties = this.CreateMessageProperties(); - - this.SendMessage(TestString, messageProperties); - this.ReceiveMessage<string>(TestString, messageProperties); - } - - private AmqpProperties CreateMessageProperties() - { - Dictionary<string, string> messageProperties = Util.GetProperties("..\\..\\MessageProperties.txt"); - - AmqpProperties amqpProperties = new AmqpProperties(); - amqpProperties.ContentType = (string)messageProperties["ContentType"]; - amqpProperties.Durable = Convert.ToBoolean((string)messageProperties["Durable"]); - amqpProperties.RoutingKey = (string)messageProperties["RoutingKey"]; - amqpProperties.TimeToLive = TimeSpan.Parse((string)messageProperties["TimeToLive"]); - - return amqpProperties; - } - - private void SendMessage(object objectToSend, AmqpProperties propertiesToSend) - { - ChannelFactory<IOutputChannel> channelFactory = - new ChannelFactory<IOutputChannel>(Util.GetBinding(), SendToUri); - IOutputChannel proxy = channelFactory.CreateChannel(); - proxy.Open(); - - Message toSend = Message.CreateMessage(MessageVersion.Default, string.Empty, objectToSend); - toSend.Properties["AmqpProperties"] = propertiesToSend; - proxy.Send(toSend); - - toSend.Close(); - proxy.Close(); - channelFactory.Close(); - } - - private void ReceiveMessage<TObjectType>(TObjectType objectToMatch, AmqpProperties expectedProperties) - { - Uri receiveFromUri = new Uri("amqp:message_queue"); - IChannelListener<IInputChannel> listener = Util.GetBinding().BuildChannelListener<IInputChannel>(receiveFromUri, new BindingParameterCollection()); - listener.Open(); - IInputChannel service = listener.AcceptChannel(TimeSpan.FromSeconds(10)); - service.Open(); - Message receivedMessage = service.Receive(TimeSpan.FromSeconds(10)); - try - { - TObjectType receivedObject = receivedMessage.GetBody<TObjectType>(); - Assert.True(receivedObject.Equals(objectToMatch), "Original and deserialized objects do not match"); - - AmqpProperties receivedProperties = (AmqpProperties)receivedMessage.Properties["AmqpProperties"]; - PropertyInfo[] propInfo = typeof(AmqpProperties).GetProperties(); - - for (int i = 0; i < propInfo.Length; i++) - { - string propertyName = propInfo[i].Name; - if (propertyName.Equals("RoutingKey", StringComparison.InvariantCultureIgnoreCase)) - { - Assert.AreEqual(RoutingKey, Convert.ToString(propInfo[i].GetValue(receivedProperties, null))); - } - else - { - Assert.AreEqual(Convert.ToString(propInfo[i].GetValue(expectedProperties, null)), Convert.ToString(propInfo[i].GetValue(receivedProperties, null))); - } - } - } - catch (NullReferenceException) - { - Assert.Fail("Message not received"); - } - catch (SerializationException) - { - Assert.Fail("Deserialized object not of correct type"); - } - finally - { - receivedMessage.Close(); - service.Close(); - listener.Close(); - } - } - } -} diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageService.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageService.cs deleted file mode 100644 index 581464d25e..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MessageService.cs +++ /dev/null @@ -1,198 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System; - using System.Collections.Generic; - using System.ServiceModel; - using System.ServiceModel.Channels; - using System.Threading; - using System.Transactions; - - public class MessageService : IQueuedDatagramService1, IQueuedDatagramService2, IQueuedDatagramService3, IInteropService, IQueuedServiceUsingTransactionScope, IQueuedServiceUsingTSRAttribute - { - private static Dictionary<string, int> methodCallCount = new Dictionary<string, int>(); - private static ServiceHost serviceHost; - - public static EventWaitHandle CompletionHandle - { - get; - set; - } - - public static int IntendedInvocationCount - { - get; - set; - } - - public static int TotalMethodCallCount - { - get; - set; - } - - // The test must set the following paramters - public static List<Type> ContractTypes - { - get; - set; - } - - public static string EndpointAddress - { - get; - set; - } - - public static void DisplayCounts() - { - Console.WriteLine("Method calls:"); - foreach (string key in methodCallCount.Keys) - { - Console.WriteLine(" {0}: {1}", key, methodCallCount[key]); - } - - Console.WriteLine("Total: {0}", TotalMethodCallCount); - } - - public static void StartService(Binding amqpBinding) - { - MessageService.methodCallCount.Clear(); - MessageService.TotalMethodCallCount = 0; - - serviceHost = new ServiceHost(typeof(MessageService)); - - foreach (Type contractType in ContractTypes) - { - serviceHost.AddServiceEndpoint(contractType, amqpBinding, EndpointAddress); - } - - serviceHost.Open(); - } - - public static bool IsServiceRunning() - { - return (serviceHost != null && serviceHost.State == CommunicationState.Opened) ? true : false; - } - - public static void StopService() - { - if (serviceHost.State != CommunicationState.Faulted) - { - try - { - serviceHost.Close(); - } - catch (Exception e) - { - Console.WriteLine("An exception was thrown while trying to close the service host.\n" + e); - } - } - else - { - Console.WriteLine("Service Faulted."); - } - } - - public void UpdateCounts(string method) - { - lock (methodCallCount) - { - if (!methodCallCount.ContainsKey(method)) - { - methodCallCount[method] = 0; - } - - ++methodCallCount[method]; - ++TotalMethodCallCount; - - if (TotalMethodCallCount >= IntendedInvocationCount && CompletionHandle != null) - { - CompletionHandle.Set(); - } - } - } - - [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] - void IQueuedServiceUsingTransactionScope.Hello(string message) - { - this.UpdateCounts("IQueuedServiceUsingTransactionScope.Hello"); - - if (message.Trim().ToLower().StartsWith("abort")) - { - throw new Exception(); - } - } - - [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] - void IQueuedServiceUsingTSRAttribute.Hello(string message) - { - this.UpdateCounts("IQueuedServiceUsingTSRAttribute.Hello"); - - if (message.Trim().ToLower().StartsWith("abort")) - { - Transaction.Current.Rollback(); - } - } - - [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] - void IQueuedDatagramService1.Hello(string message) - { - this.UpdateCounts("IQueuedDatagramService1.Hello"); - } - - [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] - void IQueuedDatagramService1.Goodbye() - { - this.UpdateCounts("IQueuedDatagramService1.Goodbye"); - } - - [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] - void IQueuedDatagramService2.Hello(string message) - { - this.UpdateCounts("IQueuedDatagramService2.Hello"); - } - - [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] - void IQueuedDatagramService2.Goodbye() - { - this.UpdateCounts("IQueuedDatagramService2.Goodbye"); - } - - [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] - void IQueuedDatagramService3.Hello(string message) - { - this.UpdateCounts("IQueuedDatagramService3.Hello"); - } - - [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] - void IQueuedDatagramService3.Goodbye() - { - this.UpdateCounts("IQueuedDatagramService3.Goodbye"); - } - - [OperationBehavior(TransactionScopeRequired = true, TransactionAutoComplete = true)] - void IInteropService.Hello(Message message) - { - this.UpdateCounts("IInteropService.Hello"); - } - } -} diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MultipleEndpointsSameQueueTest.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MultipleEndpointsSameQueueTest.cs deleted file mode 100644 index d09832757a..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/MultipleEndpointsSameQueueTest.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System; - using System.Collections.Generic; - using System.Reflection; - using System.ServiceModel; - using System.Threading; - using NUnit.Framework; - - [TestFixture] - public class MultipleEndpointsSameQueueTest - { - private MessageClient client; - - [SetUp] - public void Setup() - { - // Create client - this.client = new MessageClient(); - this.client.NumberOfMessages = 3; - this.client.NumberOfIterations = 5; - - // Setup and start service - MessageService.EndpointAddress = "amqp:message_queue"; - - MessageService.ContractTypes = new List<Type>(); - MessageService.ContractTypes.Add(typeof(IQueuedDatagramService1)); - MessageService.ContractTypes.Add(typeof(IQueuedDatagramService2)); - MessageService.ContractTypes.Add(typeof(IQueuedDatagramService3)); - MessageService.CompletionHandle = new EventWaitHandle(false, EventResetMode.AutoReset); - MessageService.IntendedInvocationCount = this.client.NumberOfIterations * (this.client.NumberOfMessages + 1) * MessageService.ContractTypes.Count; - - MessageService.StartService(Util.GetBinding()); - } - - [Test] - public void Run() - { - // Create wcf amqpchannel and send messages - MethodInfo runClientMethod = this.client.GetType().GetMethod("RunClient"); - EndpointAddress address = new EndpointAddress("amqp:amq.direct?routingkey=routing_key"); - - foreach (Type contractType in MessageService.ContractTypes) - { - MethodInfo runClientT = runClientMethod.MakeGenericMethod(contractType); - runClientT.Invoke(this.client, new object[] { address }); - } - - // Allow the wcf service to process all the messages before validation - MessageService.CompletionHandle.WaitOne(TimeSpan.FromSeconds(10.0), false); - - // Validation - int expectedMethodCallCount = this.client.NumberOfIterations * (this.client.NumberOfMessages + 1) * MessageService.ContractTypes.Count; - - Assert.AreEqual(expectedMethodCallCount, MessageService.TotalMethodCallCount); - } - - [TearDown] - public void Cleanup() - { - MessageService.StopService(); - } - } -} diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/Properties/AssemblyInfo.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/Properties/AssemblyInfo.cs deleted file mode 100644 index b47a25494f..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* -* 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.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("Apache.Qpid.Test.Channel.Functional")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("")] -[assembly: AssemblyCopyright("")] -[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("552dca74-b5a3-4ad3-a718-4a1dd03db039")] - -// 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")] diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/RunTests.bat b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/RunTests.bat deleted file mode 100755 index a5eed8839b..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/RunTests.bat +++ /dev/null @@ -1,34 +0,0 @@ -@echo OFF - -REM Licensed to the Apache Software Foundation (ASF) under one -REM or more contributor license agreements. See the NOTICE file -REM distributed with this work for additional information -REM regarding copyright ownership. The ASF licenses this file -REM to you under the Apache License, Version 2.0 (the -REM "License"); you may not use this file except in compliance -REM with the License. You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, -REM software distributed under the License is distributed on an -REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -REM KIND, either express or implied. See the License for the -REM specific language governing permissions and limitations -REM under the License. - - -set nunit_exe=%programfiles%\NUnit 2.5.1\bin\net-2.0\nunit-console.exe -set qpid_dll_location=%QPID_BUILD_ROOT%\src\Debug -set configuration_name=bin\Debug -set qcreate_location=..\..\..\..\..\..\tools\QCreate\Debug - -copy %qpid_dll_location%\qpidclientd.dll %configuration_name% -copy %qpid_dll_location%\qpidcommond.dll %configuration_name% - -copy %qpid_dll_location%\qpidclientd.dll %qcreate_location% -copy %qpid_dll_location%\qpidcommond.dll %qcreate_location% - -%qcreate_location%\QCreate.exe amq.direct routing_key message_queue - -"%nunit_exe%" %configuration_name%\Apache.Qpid.Test.Channel.Functional.dll diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/Util.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/Util.cs deleted file mode 100644 index f08a6fbbfc..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/Functional/Util.cs +++ /dev/null @@ -1,157 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one -* or more contributor license agreements. See the NOTICE file -* distributed with this work for additional information -* regarding copyright ownership. The ASF licenses this file -* to you under the Apache License, Version 2.0 (the -* "License"); you may not use this file except in compliance -* with the License. You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, -* software distributed under the License is distributed on an -* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -* KIND, either express or implied. See the License for the -* specific language governing permissions and limitations -* under the License. -*/ - -namespace Apache.Qpid.Test.Channel.Functional -{ - using System; - using System.Collections.Generic; - using System.IO; - using System.ServiceModel; - using System.ServiceModel.Channels; - using Apache.Qpid.Channel; - - internal class Util - { - public static Dictionary<string, string> GetProperties(string path) - { - string fileData = string.Empty; - using (StreamReader sr = new StreamReader(path)) - { - fileData = sr.ReadToEnd().Replace("\r", string.Empty); - } - - Dictionary<string, string> properties = new Dictionary<string, string>(); - string[] kvp; - string[] records = fileData.Split("\n".ToCharArray()); - foreach (string record in records) - { - if (record[0] == '/' || record[0] == '*') - { - continue; - } - - kvp = record.Split("=".ToCharArray()); - properties.Add(kvp[0], kvp[1]); - } - - return properties; - } - - public static Binding GetBinding() - { - return new AmqpBinding(); - } - - public static Binding GetCustomBinding() - { - AmqpTransportBindingElement transportElement = new AmqpTransportBindingElement(); - RawMessageEncodingBindingElement encodingElement = new RawMessageEncodingBindingElement(); - transportElement.BrokerHost = "127.0.0.1"; - transportElement.TransferMode = TransferMode.Streamed; - - CustomBinding brokerBinding = new CustomBinding(); - brokerBinding.Elements.Add(encodingElement); - brokerBinding.Elements.Add(transportElement); - - return brokerBinding; - } - - public static int GetMessageCountFromQueue(string listenUri) - { - Message receivedMessage = null; - int messageCount = 0; - - IChannelListener<IInputChannel> listener = Util.GetBinding().BuildChannelListener<IInputChannel>(new Uri(listenUri), new BindingParameterCollection()); - listener.Open(); - IInputChannel proxy = listener.AcceptChannel(TimeSpan.FromSeconds(10)); - proxy.Open(); - - while (true) - { - try - { - receivedMessage = proxy.Receive(TimeSpan.FromSeconds(3)); - } - catch (Exception e) - { - if (e.GetType() == typeof(TimeoutException)) - { - break; - } - else - { - throw; - } - } - - messageCount++; - } - - listener.Close(); - return messageCount; - } - - public static void PurgeQueue(string listenUri) - { - GetMessageCountFromQueue(listenUri); - } - - public static bool CompareResults(List<string> expectedResults, List<string> actualResults) - { - IEnumerator<string> actualResultEnumerator = actualResults.GetEnumerator(); - IEnumerator<string> expectedResultEnumerator = expectedResults.GetEnumerator(); - - bool expectedResultEnumeratorPosition = expectedResultEnumerator.MoveNext(); - bool actualResultEnumeratorPosition = actualResultEnumerator.MoveNext(); - - while (true == actualResultEnumeratorPosition && - true == expectedResultEnumeratorPosition) - { - string expectedResult = expectedResultEnumerator.Current; - string actualResult = actualResultEnumerator.Current; - - if (expectedResult.Equals(actualResult) == false) - { - Console.WriteLine("OrderedResultsComparator: Expected result '{0}', but got '{1}' instead.", expectedResult, actualResult); - return false; - } - - expectedResultEnumeratorPosition = expectedResultEnumerator.MoveNext(); - actualResultEnumeratorPosition = actualResultEnumerator.MoveNext(); - } - - // if either of them has still more data left, its an error - if (true == expectedResultEnumeratorPosition) - { - string expectedResult = expectedResultEnumerator.Current; - Console.WriteLine("OrderedResultsComparator: Got fewer results than expected, first missing result: '{0}'", expectedResult); - return false; - } - - if (true == actualResultEnumeratorPosition) - { - string actualResult = actualResultEnumerator.Current; - Console.WriteLine("OrderedResultsComparator: Got more results than expected, first extra result: '{0}'", actualResult); - return false; - } - - return true; - } - } -} diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/WcfPerftest/RawBodyUtility.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/WcfPerftest/RawBodyUtility.cs deleted file mode 100644 index 55a01c790c..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/WcfPerftest/RawBodyUtility.cs +++ /dev/null @@ -1,161 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Test.Channel.WcfPerftest
-{
- using System;
- using System.Collections;
- using System.IO;
- using System.ServiceModel;
- using System.ServiceModel.Channels;
- using System.ServiceModel.Description;
- using System.Threading;
- using System.Text;
- using System.Xml;
- using Apache.Qpid.Channel;
-
-
- /// <summary>
- /// A sample interface for populating and extracting message body content.
- /// Just enough methods to handle basic Interop text and raw byte messages.
- /// </summary>
-
-
- public interface IRawBodyUtility
- {
- Message CreateMessage(byte[] body, int offset, int len);
- Message CreateMessage(byte[] body);
- byte[] GetBytes(Message m, byte[] recyclableBuffer);
-
- Message CreateMessage(string body);
- string GetText(Message m);
- }
-
- // an implementation of IRawBodyUtility that expects a RawMessageEncoder based channel
-
- public class RawEncoderUtility : IRawBodyUtility
- {
- public Message CreateMessage(byte[] body, int offset, int count)
- {
- return Message.CreateMessage(MessageVersion.None, "", new RawEncoderBodyWriter(body, offset, count));
- }
-
- public Message CreateMessage(byte[] body)
- {
- return CreateMessage(body, 0, body.Length);
- }
-
- public byte[] GetBytes(Message message, byte[] recyclableBuffer)
- {
- XmlDictionaryReader reader = message.GetReaderAtBodyContents();
- int length;
-
- while (!reader.HasValue)
- {
- reader.Read();
- if (reader.EOF)
- {
- throw new InvalidDataException("empty XmlDictionaryReader");
- }
- }
-
- if (reader.TryGetBase64ContentLength(out length))
- {
- byte[] bytes = null;
- if (recyclableBuffer != null)
- {
- if (recyclableBuffer.Length == length)
- {
- // reuse
- bytes = recyclableBuffer;
- }
- }
-
- if (bytes == null)
- {
- bytes = new byte[length];
- }
-
- // this is the single copy mechanism from native to managed space with no intervening
- // buffers. One could also write a method GetBytes(msg, myBuf, offset)...
- reader.ReadContentAsBase64(bytes, 0, length);
- reader.Close();
- return bytes;
- }
- else
- {
- // uses whatever default buffering mechanism is used by the base XmlDictionaryReader class
- return reader.ReadContentAsBase64();
- }
- }
-
- public Message CreateMessage(string body)
- {
- return Message.CreateMessage(MessageVersion.None, "", new RawEncoderBodyWriter(body));
- }
-
- public string GetText(Message message)
- {
- byte[] rawBuffer = GetBytes(message, null);
- return Encoding.UTF8.GetString(rawBuffer, 0, rawBuffer.Length);
- }
-
- internal class RawEncoderBodyWriter : BodyWriter
- {
- // works only with the Raw Encoder; the "body" is either a single string or byte[] segment
- String bodyAsString;
- byte[] bodyAsBytes;
- int offset;
- int count;
-
- public RawEncoderBodyWriter(string body)
- : base(false) // isBuffered
- {
- this.bodyAsString = body;
- }
-
- public RawEncoderBodyWriter(byte[] body, int offset, int count)
- : base(false) // isBuffered
- {
- this.bodyAsBytes = body;
- this.offset = offset;
- this.count = count;
- }
-
- protected override void OnWriteBodyContents(System.Xml.XmlDictionaryWriter writer)
- {
- // TODO: RawMessageEncoder.StreamElementName should be public.
- writer.WriteStartElement("Binary"); // the expected Raw encoder "<Binary>" virtual xml tag
-
- if (bodyAsString != null)
- {
- byte[] buf = Encoding.UTF8.GetBytes(bodyAsString);
- writer.WriteBase64(buf, 0, buf.Length);
- }
- else
- {
- writer.WriteBase64(this.bodyAsBytes, this.offset, this.count);
- }
-
- writer.WriteEndElement();
- }
- }
- }
-
-}
diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/WcfPerftest/WcfPerftest.cs b/qpid/wcf/test/Apache/Qpid/Test/Channel/WcfPerftest/WcfPerftest.cs deleted file mode 100644 index c97d3da27c..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/WcfPerftest/WcfPerftest.cs +++ /dev/null @@ -1,783 +0,0 @@ -/*
-* Licensed to the Apache Software Foundation (ASF) under one
-* or more contributor license agreements. See the NOTICE file
-* distributed with this work for additional information
-* regarding copyright ownership. The ASF licenses this file
-* to you under the Apache License, Version 2.0 (the
-* "License"); you may not use this file except in compliance
-* with the License. You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing,
-* software distributed under the License is distributed on an
-* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-* KIND, either express or implied. See the License for the
-* specific language governing permissions and limitations
-* under the License.
-*/
-
-namespace Apache.Qpid.Test.Channel.WcfPerftest
-{
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Configuration;
- using System.Diagnostics;
- using System.IO;
- using System.ServiceModel;
- using System.ServiceModel.Channels;
- using System.ServiceModel.Description;
- using System.Threading;
- using System.Transactions;
- using System.Text;
- using System.Xml;
- using Apache.Qpid.AmqpTypes;
- using Apache.Qpid.Channel;
-
- // this program implements a subset of the functionality in qpid\cpp\src\tests\perftest.cpp
-
- // for a given broker, create reader and writer channels to queues/exchanges
- // lazilly creates binding and channel factories
-
- public class QueueChannelFactory
- {
- private static AmqpBinding brokerBinding;
- private static BindingParameterCollection bindingParameters;
- private static IChannelFactory<IInputChannel> readerFactory;
- private static IChannelFactory<IOutputChannel> writerFactory;
- private static string brokerAddr = "127.0.0.1";
- private static int brokerPort = 5672;
- private static string userName;
- private static string password;
- private static bool ssl = false;
-
- public static void SetBroker(string addr, int port)
- {
- brokerAddr = addr;
- brokerPort = port;
- }
-
- public static void SetSecurity(bool sslMode, string name, string pass)
- {
- ssl = sslMode;
- if (name != null)
- {
- userName = name;
- password = pass;
- }
- }
-
- private static void InitializeBinding()
- {
- AmqpBinaryBinding binding = new AmqpBinaryBinding();
- bindingParameters = new BindingParameterCollection();
-
- binding.BrokerHost = brokerAddr;
- binding.BrokerPort = brokerPort;
- binding.TransferMode = TransferMode.Streamed;
- binding.PrefetchLimit = 5000;
- binding.Shared = true;
-
- if (ssl || (userName != null))
- {
- binding.Security.Mode = AmqpSecurityMode.Transport;
- binding.Security.Transport.UseSSL = ssl;
-
- if (userName != null)
- {
- binding.Security.Transport.CredentialType = AmqpCredentialType.Plain;
-
- ClientCredentials credentials = new ClientCredentials();
- credentials.UserName.UserName = userName;
- credentials.UserName.Password = password;
- bindingParameters.Add(credentials);
- }
- }
-
- brokerBinding = binding;
- }
-
- public static IInputChannel CreateReaderChannel(string queueName)
- {
- lock (typeof(QueueChannelFactory))
- {
- if (brokerBinding == null)
- {
- InitializeBinding();
- }
-
- if (readerFactory == null)
- {
- readerFactory = brokerBinding.BuildChannelFactory<IInputChannel>(bindingParameters);
- readerFactory.Open();
- }
-
- IInputChannel channel = readerFactory.CreateChannel(new EndpointAddress(
- new Uri("amqp:" + queueName)));
- channel.Open();
-
- return channel;
- }
- }
-
- public static IOutputChannel CreateWriterChannel(string exchangeName, string routingKey)
- {
- lock (typeof(QueueChannelFactory))
- {
- if (brokerBinding == null)
- {
- InitializeBinding();
- }
-
- if (writerFactory == null)
- {
- writerFactory = brokerBinding.BuildChannelFactory<IOutputChannel>(bindingParameters);
- writerFactory.Open();
- }
-
- IOutputChannel channel = writerFactory.CreateChannel(new EndpointAddress(
- "amqp:" + exchangeName +
- "?routingkey=" + routingKey));
- channel.Open();
-
- return channel;
- }
- }
- }
-
- public enum ClientType
- {
- Publisher,
- Subscriber,
- InteropDemo
- }
-
- public enum SaslMechanism
- {
- None,
- Plain
- }
-
- public class Options
- {
- public string broker;
- public int port;
- public UInt64 messageCount;
- public int messageSize;
- public ClientType type;
- public string baseName;
- public int subTxSize;
- public int pubTxSize;
- public bool durable;
- public bool ssl;
- public string username;
- public string password;
- public SaslMechanism saslMechanism;
-
- public Options()
- {
- this.broker = "127.0.0.1";
- this.port = 5672;
- this.messageCount = 500000;
- this.messageSize = 1024;
- this.type = ClientType.InteropDemo; // default: once as pub and once as sub
- this.baseName = "qpid-perftest";
- this.pubTxSize = 0;
- this.subTxSize = 0;
- this.durable = false;
- this.ssl = false;
- this.username = null;
- this.password = null;
- this.saslMechanism = SaslMechanism.None;
- }
-
- public void Parse(string[] args)
- {
- int argCount = args.Length;
- int current = 0;
- bool typeSelected = false;
-
- while (current < argCount)
- {
- string arg = args[current];
- if (arg == "--publish")
- {
- if (typeSelected)
- throw new ArgumentException("too many roles");
-
- this.type = ClientType.Publisher;
- typeSelected = true;
- }
- else if (arg == "--subscribe")
- {
- if (typeSelected)
- throw new ArgumentException("too many roles");
-
- this.type = ClientType.Subscriber;
- typeSelected = true;
- }
- else if (arg == "--size")
- {
- arg = args[++current];
- int i = int.Parse(arg);
- if (i > 0)
- {
- this.messageSize = i;
- }
- }
- else if (arg == "--count")
- {
- arg = args[++current];
- UInt64 i = UInt64.Parse(arg);
- if (i > 0)
- {
- this.messageCount = i;
- }
- }
- else if (arg == "--broker")
- {
- this.broker = args[++current];
- }
- else if (arg == "--port")
- {
- arg = args[++current];
- int i = int.Parse(arg);
- if (i > 0)
- {
- this.port = i;
- }
- }
- else if (arg == "--base-name")
- {
- this.baseName = args[++current];
- }
-
- else if (arg == "--tx")
- {
- arg = args[++current];
- int i = int.Parse(arg);
- if (i > 0)
- {
- this.subTxSize = i;
- this.pubTxSize = i;
- }
- }
-
- else if (arg == "--durable")
- {
- arg = args[++current];
- if (arg.Equals("yes"))
- {
- this.durable = true;
- }
- }
-
- else if (arg == "--protocol")
- {
- arg = args[++current];
- if (arg.Equals("ssl"))
- {
- this.ssl = true;
- }
- }
-
- else if (arg == "--username")
- {
- this.username = args[++current];
- }
-
- else if (arg == "--password")
- {
- this.password = args[++current];
- }
-
- else if (arg == "--mechanism")
- {
- arg = args[++current];
- if (arg.Equals("PLAIN", StringComparison.OrdinalIgnoreCase))
- {
- this.saslMechanism = SaslMechanism.Plain;
- }
- }
-
- else
- {
- throw new ArgumentException(String.Format("unknown argument \"{0}\"", arg));
- }
-
- current++;
- }
-
- if (this.saslMechanism == SaslMechanism.Plain)
- {
- // use guest/guest as defaults if neither is specified
- if ((this.username == null) && (this.password == null))
- {
- this.username = "guest";
- this.password = "guest";
- }
- else
- {
- if (this.username == null)
- {
- this.username = "";
- }
- if (this.password == null)
- {
- this.password = "";
- }
- }
- }
-
- }
- }
-
-
- public class Client
- {
- protected Options opts;
-
- public static void Expect(string actual, string expect)
- {
- if (expect != actual)
- {
- throw new Exception("Expecting " + expect + " but received " + actual);
- }
- }
-
- public static void Close(IChannel channel)
- {
- if (channel == null)
- {
- return;
- }
-
- try
- {
- channel.Close();
- }
- catch (Exception e)
- {
- Console.WriteLine("channel close exception {0}", e);
- }
- }
-
- public string Fqn(string name)
- {
- return opts.baseName + '_' + name;
- }
- }
-
-
- public class WcfPerftest
- {
- static void WarmUpTransactionSubsystem(Options opts)
- {
- // see if any use of transactions is expected
- if ((opts.type == ClientType.Publisher) && (opts.pubTxSize == 0))
- return;
-
- if ((opts.type == ClientType.Subscriber) && (opts.subTxSize == 0))
- return;
-
- if (opts.type == ClientType.InteropDemo)
- {
- if ((opts.subTxSize == 0) && (opts.pubTxSize == 0))
- return;
- }
-
- Console.WriteLine("Initializing transactions");
- IRawBodyUtility bodyUtil = new RawEncoderUtility();
-
- // Send a transacted message to nowhere to force the initial registration with MSDTC.
- // MSDTC insists on verifying it can contact the resource in the manner expected for
- // recovery. This requires setting up and finishing a separate connection to the
- // broker by a thread owned by the DTC. Excluding this time allows the existing
- // reporting mechanisms to better reflect the cost per transaction without requiring
- // long test runs.
- IOutputChannel channel = QueueChannelFactory.CreateWriterChannel("amq.direct", Guid.NewGuid().ToString());
- Message msg = bodyUtil.CreateMessage("sacrificial transacted message from WcfPerftest");
- using (TransactionScope ts = new TransactionScope())
- {
- channel.Send(msg);
- // abort/rollback
- ts.Dispose();
- }
- channel.Close();
- Console.WriteLine("transaction resource manager ready");
- }
-
-
- // demonstrate message exchange between WcfPerftest.exe and native
- // C++ perftest.exe
-
- static void InteropDemo(Options opts)
- {
- string perftest_cpp_exe = "qpid-perftest.exe";
- string commonArgs = String.Format(" --count {0} --size {1} --broker {2} --port {3}", opts.messageCount, opts.messageSize, opts.broker, opts.port);
-
- if (opts.durable)
- {
- commonArgs += " --durable yes";
- }
-
- if (opts.ssl)
- {
- commonArgs += " --protocol ssl";
- }
-
- if (opts.saslMechanism == SaslMechanism.Plain)
- {
- commonArgs += String.Format(" --username {0} --password {1} --mechanism PLAIN", opts.username, opts.password);
- }
-
- Console.WriteLine("===== WCF Subscriber and C++ Publisher =====");
-
- Process setup = new Process();
- setup.StartInfo.FileName = perftest_cpp_exe;
- setup.StartInfo.UseShellExecute = false;
- setup.StartInfo.Arguments = "--setup" + commonArgs;
- try
- {
- setup.Start();
- }
- catch (Win32Exception win32e)
- {
- Console.WriteLine("Cannot execute {0}: PATH not set?", perftest_cpp_exe);
- Console.WriteLine(" Error: {0}", win32e.Message);
- return;
- }
- setup.WaitForExit();
-
- Process control = new Process();
- control.StartInfo.FileName = perftest_cpp_exe;
- control.StartInfo.UseShellExecute = false;
- control.StartInfo.Arguments = "--control" + commonArgs;
- control.Start();
-
- Process publish = new Process();
- publish.StartInfo.FileName = perftest_cpp_exe;
- publish.StartInfo.UseShellExecute = false;
- publish.StartInfo.Arguments = "--publish" + commonArgs;
- publish.Start();
-
- SubscribeThread subscribeWcf = new SubscribeThread(opts.baseName + "0", opts);
- Thread subThread = new Thread(subscribeWcf.Run);
- subThread.Start();
-
- subThread.Join();
- publish.WaitForExit();
- control.WaitForExit();
-
- Console.WriteLine();
- Console.WriteLine("===== WCF Publisher and C++ Subscriber =====");
-
- setup = new Process();
- setup.StartInfo.FileName = perftest_cpp_exe;
- setup.StartInfo.UseShellExecute = false;
- setup.StartInfo.Arguments = "--setup" + commonArgs;
- setup.Start();
- setup.WaitForExit();
-
- control = new Process();
- control.StartInfo.FileName = perftest_cpp_exe;
- control.StartInfo.UseShellExecute = false;
- control.StartInfo.Arguments = "--control" + commonArgs;
- control.Start();
-
- PublishThread pub = new PublishThread(opts.baseName + "0", "", opts);
- Thread pubThread = new Thread(pub.Run);
- pubThread.Start();
-
- Process subscribeCpp = new Process();
- subscribeCpp.StartInfo.FileName = perftest_cpp_exe;
- subscribeCpp.StartInfo.UseShellExecute = false;
- subscribeCpp.StartInfo.Arguments = "--subscribe" + commonArgs;
- subscribeCpp.Start();
-
- subscribeCpp.WaitForExit();
- pubThread.Join();
- control.WaitForExit();
- }
-
- static void Main(string[] mainArgs)
- {
- Options opts = new Options();
- opts.Parse(mainArgs);
- QueueChannelFactory.SetBroker(opts.broker, opts.port);
- QueueChannelFactory.SetSecurity(opts.ssl, opts.username, opts.password);
-
- WarmUpTransactionSubsystem(opts);
-
- if (opts.type == ClientType.Publisher)
- {
- PublishThread pub = new PublishThread(opts.baseName + "0", "", opts);
- Thread pubThread = new Thread(pub.Run);
- pubThread.Start();
- pubThread.Join();
- }
- else if (opts.type == ClientType.Subscriber)
- {
- SubscribeThread sub = new SubscribeThread(opts.baseName + "0", opts);
- Thread subThread = new Thread(sub.Run);
- subThread.Start();
- subThread.Join();
- }
- else
- {
- InteropDemo(opts);
- }
-
- if (System.Diagnostics.Debugger.IsAttached)
- {
- Console.WriteLine("Hit return to continue...");
- Console.ReadLine();
- }
- }
- }
-
- public class PublishThread : Client
- {
- string destination; // exchange/queue
- string routingKey;
- int msgSize;
- UInt64 msgCount;
- IOutputChannel publishQueue;
-
- public PublishThread(string key, string q, Options opts)
- {
- this.routingKey = key;
- this.destination = q;
- this.msgSize = opts.messageSize;
- this.msgCount = opts.messageCount;
- this.opts = opts;
- }
-
- static void StampSequenceNo(byte[] data, UInt64 n)
- {
- int wordLen = IntPtr.Size; // mimic size_t in C++
-
- if (data.Length < wordLen)
- throw new ArgumentException("message size");
- for (int i = 0; i < wordLen; i++)
- {
- data[i] = (byte) (n & 0xff);
- n >>= 8;
- }
- }
-
- public void Run()
- {
- IRawBodyUtility bodyUtil = new RawEncoderUtility();
-
- IInputChannel startQueue = null;
- IOutputChannel doneQueue = null;
- UInt64 batchSize = (UInt64)opts.pubTxSize;
- bool txPending = false;
- AmqpProperties amqpProperties = null;
-
- if (opts.durable)
- {
- amqpProperties = new AmqpProperties();
- amqpProperties.Durable = true;
- }
-
- try
- {
- publishQueue = QueueChannelFactory.CreateWriterChannel(this.destination, this.routingKey);
- doneQueue = QueueChannelFactory.CreateWriterChannel("", this.Fqn("pub_done"));
- startQueue = QueueChannelFactory.CreateReaderChannel(this.Fqn("pub_start"));
-
- // wait for our start signal
- Message msg;
- msg = startQueue.Receive(TimeSpan.MaxValue);
- Expect(bodyUtil.GetText(msg), "start");
- msg.Close();
-
- Stopwatch stopwatch = new Stopwatch();
- AsyncCallback sendCallback = new AsyncCallback(this.AsyncSendCB);
-
- byte[] data = new byte[this.msgSize];
- IAsyncResult sendResult = null;
-
- Console.WriteLine("sending {0}", this.msgCount);
- stopwatch.Start();
-
- if (batchSize > 0)
- {
- Transaction.Current = new CommittableTransaction();
- }
-
- for (UInt64 i = 0; i < this.msgCount; i++)
- {
- StampSequenceNo(data, i);
- msg = bodyUtil.CreateMessage(data);
- if (amqpProperties != null)
- {
- msg.Properties.Add("AmqpProperties", amqpProperties);
- }
-
- sendResult = publishQueue.BeginSend(msg, TimeSpan.MaxValue, sendCallback, msg);
-
- if (batchSize > 0)
- {
- txPending = true;
- if (((i + 1) % batchSize) == 0)
- {
- ((CommittableTransaction)Transaction.Current).Commit();
- txPending = false;
- Transaction.Current = new CommittableTransaction();
- }
- }
- }
-
- if (txPending)
- {
- ((CommittableTransaction)Transaction.Current).Commit();
- }
-
- Transaction.Current = null;
-
- sendResult.AsyncWaitHandle.WaitOne();
- stopwatch.Stop();
-
- double mps = (msgCount / stopwatch.Elapsed.TotalSeconds);
-
- msg = bodyUtil.CreateMessage(String.Format("{0:0.##}", mps));
- doneQueue.Send(msg, TimeSpan.MaxValue);
- msg.Close();
- }
- finally
- {
- Close((IChannel)doneQueue);
- Close((IChannel)publishQueue);
- Close(startQueue);
- }
- }
-
- void AsyncSendCB(IAsyncResult result)
- {
- publishQueue.EndSend(result);
- ((Message)result.AsyncState).Close();
- }
- }
-
- public class SubscribeThread : Client
- {
- string queue;
- int msgSize;
- UInt64 msgCount;
- IInputChannel subscribeQueue;
-
- public SubscribeThread(string q, Options opts)
- {
- this.queue = q;
- this.msgSize = opts.messageSize;
- this.msgCount = opts.messageCount;
- this.opts = opts;
- }
-
- static UInt64 GetSequenceNumber(byte[] data)
- {
- int wordLen = IntPtr.Size; // mimic size_t in C++
-
- if (data.Length < wordLen)
- throw new ArgumentException("message size");
- UInt64 n = 0;
- for (int i = (wordLen - 1); i >= 0; i--)
- {
- n = (256 * n) + data[i];
- }
- return n;
- }
-
- public void Run()
- {
- IRawBodyUtility bodyUtil = new RawEncoderUtility();
-
- IOutputChannel readyQueue = null;
- IOutputChannel doneQueue = null;
- UInt64 batchSize = (UInt64)opts.subTxSize;
- bool txPending = false;
- byte[] data = null;
-
- try
- {
- this.subscribeQueue = QueueChannelFactory.CreateReaderChannel(this.queue);
- readyQueue = QueueChannelFactory.CreateWriterChannel("", this.Fqn("sub_ready"));
- doneQueue = QueueChannelFactory.CreateWriterChannel("", this.Fqn("sub_done"));
-
- Message msg = bodyUtil.CreateMessage("ready");
- readyQueue.Send(msg, TimeSpan.MaxValue);
- msg.Close();
-
-
- Stopwatch stopwatch = new Stopwatch();
- stopwatch.Start();
-
- Console.WriteLine("receiving {0}", this.msgCount);
- UInt64 expect = 0;
-
- if (batchSize > 0)
- {
- Transaction.Current = new CommittableTransaction();
- }
-
- for (UInt64 i = 0; i < this.msgCount; i++)
- {
- msg = subscribeQueue.Receive(TimeSpan.MaxValue);
-
- data = bodyUtil.GetBytes(msg, data);
- msg.Close();
- if (data.Length != this.msgSize)
- {
- throw new Exception("subscribe message size mismatch");
- }
-
- UInt64 n = GetSequenceNumber(data);
- if (n != expect)
- {
- throw new Exception(String.Format("message sequence error. expected {0} got {1}", expect, n));
- }
- expect = n + 1;
-
- if (batchSize > 0)
- {
- txPending = true;
- if (((i + 1) % batchSize) == 0)
- {
- ((CommittableTransaction)Transaction.Current).Commit();
- txPending = false;
- Transaction.Current = new CommittableTransaction();
- }
- }
- }
-
- if (txPending)
- {
- ((CommittableTransaction)Transaction.Current).Commit();
- }
-
- Transaction.Current = null;
-
- stopwatch.Stop();
-
- double mps = (msgCount / stopwatch.Elapsed.TotalSeconds);
-
- msg = bodyUtil.CreateMessage(String.Format("{0:0.##}", mps));
- doneQueue.Send(msg, TimeSpan.MaxValue);
- msg.Close();
-
- subscribeQueue.Close();
- }
- finally
- {
- Close((IChannel)doneQueue);
- Close((IChannel)this.subscribeQueue);
- Close(readyQueue);
- }
- }
- }
-}
diff --git a/qpid/wcf/test/Apache/Qpid/Test/Channel/WcfPerftest/WcfPerftest.csproj b/qpid/wcf/test/Apache/Qpid/Test/Channel/WcfPerftest/WcfPerftest.csproj deleted file mode 100644 index 44ef998a24..0000000000 --- a/qpid/wcf/test/Apache/Qpid/Test/Channel/WcfPerftest/WcfPerftest.csproj +++ /dev/null @@ -1,83 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?>
-<!--
-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.
--->
-<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>{D0F8FDE4-7AC6-4CFF-986A-50D06F7FD733}</ProjectGuid>
- <OutputType>Exe</OutputType>
- <RootNamespace>Apache.Qpid.Test.Channel.WcfPerftest</RootNamespace>
- <AssemblyName>WcfPerftest</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>bin\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>bin\Release\</OutputPath>
- <DefineConstants>TRACE</DefineConstants>
- <ErrorReport>prompt</ErrorReport>
- <WarningLevel>4</WarningLevel>
- </PropertyGroup>
- <ItemGroup>
- <Reference Include="System" />
- <Reference Include="System.Runtime.Serialization">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.ServiceModel">
- <RequiredTargetFramework>3.0</RequiredTargetFramework>
- </Reference>
- <Reference Include="System.Transactions" />
- <Reference Include="System.XML" />
- </ItemGroup>
- <ItemGroup>
- <Compile Include="WcfPerftest.cs" />
- <Compile Include="RawBodyUtility.cs" />
- </ItemGroup>
- <ItemGroup>
- <ProjectReference Include="..\..\..\..\..\..\src\Apache\Qpid\Channel\Channel.csproj">
- <Project>{8AABAB30-7D1E-4539-B7D1-05450262BAD2}</Project>
- <Name>Channel</Name>
- </ProjectReference>
- <ProjectReference Include="..\..\..\..\..\..\src\Apache\Qpid\Interop\Interop.vcproj">
- <Project>{C9B6AC75-6332-47A4-B82B-0C20E0AF2D34}</Project>
- <Name>Interop</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>
diff --git a/qpid/wcf/tools/QCreate/QCreate.cpp b/qpid/wcf/tools/QCreate/QCreate.cpp deleted file mode 100644 index 7b0231f339..0000000000 --- a/qpid/wcf/tools/QCreate/QCreate.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* -* 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. -*/ - -#include "stdafx.h" - -#include <qpid/client/Connection.h> -#include <qpid/client/Session.h> - -#include <cstdlib> -#include <iostream> - -using namespace qpid::client; -using namespace qpid::framing; - - -int main(int argc, char** argv) { - - std::string exchange = argc>1 ? argv[1] : "amq.direct"; - std::string bindingKey = argc>2 ? argv[2] : "routing_key"; - std::string queue = argc>3 ? argv[3] : "message_queue"; - - const char* host = "127.0.0.1"; - int port = 5672; - Connection connection; - - try { - connection.open(host, port); - Session session = connection.newSession(); - - - //--------- Main body of program -------------------------------------------- - - // Create a queue and route all messages whose - // routing key is "routing_key" to this newly created queue. - - session.queueDeclare(arg::queue=queue); - session.exchangeBind(arg::exchange=exchange, arg::queue=queue, arg::bindingKey=bindingKey); - - //----------------------------------------------------------------------------- - - connection.close(); - return 0; - } catch(const std::exception& error) { - std::cout << error.what() << std::endl; - } - return 1; - -} - diff --git a/qpid/wcf/tools/QCreate/QCreate.sln b/qpid/wcf/tools/QCreate/QCreate.sln deleted file mode 100644 index c01675d53a..0000000000 --- a/qpid/wcf/tools/QCreate/QCreate.sln +++ /dev/null @@ -1,40 +0,0 @@ -
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual C++ Express 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
-# 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
-#
-
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QCreate", "QCreate.vcproj", "{7CA88318-485A-4D95-A321-43DFBB6EA28B}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {7CA88318-485A-4D95-A321-43DFBB6EA28B}.Debug|Win32.ActiveCfg = Debug|Win32
- {7CA88318-485A-4D95-A321-43DFBB6EA28B}.Debug|Win32.Build.0 = Debug|Win32
- {7CA88318-485A-4D95-A321-43DFBB6EA28B}.Release|Win32.ActiveCfg = Release|Win32
- {7CA88318-485A-4D95-A321-43DFBB6EA28B}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/qpid/wcf/tools/QCreate/QCreate.vcproj b/qpid/wcf/tools/QCreate/QCreate.vcproj deleted file mode 100644 index ba77952966..0000000000 --- a/qpid/wcf/tools/QCreate/QCreate.vcproj +++ /dev/null @@ -1,232 +0,0 @@ -<?xml version="1.0" encoding="Windows-1252"?>
-<!--
-
- 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.
-
--->
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="9.00"
- Name="QCreate"
- ProjectGUID="{7CA88318-485A-4D95-A321-43DFBB6EA28B}"
- RootNamespace="QCreate"
- Keyword="Win32Proj"
- TargetFrameworkVersion="196613"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalIncludeDirectories=""$(BOOST_ROOT)\include\$(BOOST_VERSION)";"$(BOOST_ROOT)\.";..\..\..\cpp\include;"$(QPID_BUILD_ROOT)\include""
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
- MinimalRebuild="true"
- BasicRuntimeChecks="3"
- RuntimeLibrary="3"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="4"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- AdditionalDependencies="qpidcommond.lib qpidclientd.lib"
- LinkIncremental="2"
- AdditionalLibraryDirectories=".;"$(BOOST_ROOT)\lib";"$(QPID_BUILD_ROOT)\src\Debug""
- GenerateDebugInformation="true"
- SubSystem="1"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(SolutionDir)$(ConfigurationName)"
- IntermediateDirectory="$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="1"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="2"
- EnableIntrinsicFunctions="true"
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE"
- RuntimeLibrary="2"
- EnableFunctionLevelLinking="true"
- UsePrecompiledHeader="0"
- WarningLevel="3"
- DebugInformationFormat="3"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkIncremental="1"
- GenerateDebugInformation="true"
- SubSystem="1"
- OptimizeReferences="2"
- EnableCOMDATFolding="2"
- TargetMachine="1"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="Source Files"
- Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
- UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
- >
- <File
- RelativePath=".\QCreate.cpp"
- >
- </File>
- <File
- RelativePath=".\stdafx.cpp"
- >
- </File>
- </Filter>
- <Filter
- Name="Header Files"
- Filter="h;hpp;hxx;hm;inl;inc;xsd"
- UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
- >
- <File
- RelativePath=".\stdafx.h"
- >
- </File>
- <File
- RelativePath=".\targetver.h"
- >
- </File>
- </Filter>
- <Filter
- Name="Resource Files"
- Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
- UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
- >
- </Filter>
- <File
- RelativePath=".\ReadMe.txt"
- >
- </File>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/qpid/wcf/tools/QCreate/ReadMe.txt b/qpid/wcf/tools/QCreate/ReadMe.txt deleted file mode 100644 index b3efb84503..0000000000 --- a/qpid/wcf/tools/QCreate/ReadMe.txt +++ /dev/null @@ -1,52 +0,0 @@ -/* -* 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. -*/ - -======================================================================== - CONSOLE APPLICATION : QCreate Project Overview -======================================================================== - -AppWizard has created this QCreate application for you. - -This file contains a summary of what you will find in each of the files that -make up your QCreate application. - - -QCreate.vcproj - This is the main project file for VC++ projects generated using an Application Wizard. - It contains information about the version of Visual C++ that generated the file, and - information about the platforms, configurations, and project features selected with the - Application Wizard. - -QCreate.cpp - This is the main application source file. - -///////////////////////////////////////////////////////////////////////////// -Other standard files: - -StdAfx.h, StdAfx.cpp - These files are used to build a precompiled header (PCH) file - named QCreate.pch and a precompiled types file named StdAfx.obj. - -///////////////////////////////////////////////////////////////////////////// -Other notes: - -AppWizard uses "TODO:" comments to indicate parts of the source code you -should add to or customize. - -///////////////////////////////////////////////////////////////////////////// diff --git a/qpid/wcf/tools/QCreate/stdafx.cpp b/qpid/wcf/tools/QCreate/stdafx.cpp deleted file mode 100644 index 568cd3b7d6..0000000000 --- a/qpid/wcf/tools/QCreate/stdafx.cpp +++ /dev/null @@ -1,27 +0,0 @@ -/* -* 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. -*/ - -// stdafx.cpp : source file that includes just the standard includes -// QCreate.pch will be the pre-compiled header -// stdafx.obj will contain the pre-compiled type information - -#include "stdafx.h" - -// TODO: reference any additional headers you need in STDAFX.H -// and not in this file diff --git a/qpid/wcf/tools/QCreate/stdafx.h b/qpid/wcf/tools/QCreate/stdafx.h deleted file mode 100644 index a516e19a10..0000000000 --- a/qpid/wcf/tools/QCreate/stdafx.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -* 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. -*/ - -// stdafx.h : include file for standard system include files, -// or project specific include files that are used frequently, but -// are changed infrequently -// - -#pragma once - -#include "targetver.h" - -#include <stdio.h> -#include <tchar.h> - - - -// TODO: reference additional headers your program requires here diff --git a/qpid/wcf/tools/QCreate/targetver.h b/qpid/wcf/tools/QCreate/targetver.h deleted file mode 100644 index 9cfb78641b..0000000000 --- a/qpid/wcf/tools/QCreate/targetver.h +++ /dev/null @@ -1,32 +0,0 @@ -/* -* 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. -*/ - -#pragma once - -// The following macros define the minimum required platform. The minimum required platform -// is the earliest version of Windows, Internet Explorer etc. that has the necessary features to run -// your application. The macros work by enabling all features available on platform versions up to and -// including the version specified. - -// Modify the following defines if you have to target a platform prior to the ones specified below. -// Refer to MSDN for the latest info on corresponding values for different platforms. -#ifndef _WIN32_WINNT // Specifies that the minimum required platform is Windows Vista. -#define _WIN32_WINNT 0x0600 // Change this to the appropriate value to target other versions of Windows. -#endif - |